mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 22:46:16 +00:00
init
This commit is contained in:
19
app/ValidationRules/CronRule.php
Executable file
19
app/ValidationRules/CronRule.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\ValidationRules;
|
||||
|
||||
use Cron\CronExpression;
|
||||
use Illuminate\Contracts\Validation\Rule;
|
||||
|
||||
class CronRule implements Rule
|
||||
{
|
||||
public function passes($attribute, $value): bool
|
||||
{
|
||||
return CronExpression::isValidExpression($value);
|
||||
}
|
||||
|
||||
public function message(): string
|
||||
{
|
||||
return __('Invalid frequency');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user