lcly-data-admin/app/Rules/Quarter.php

31 lines
526 B
PHP

<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
class Quarter implements Rule
{
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
return in_array($value, [1, 2, 3, 4]);
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
return '季度非法';
}
}