mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-20 02:11:36 +00:00
20 lines
356 B
PHP
Executable File
20 lines
356 B
PHP
Executable File
<?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');
|
|
}
|
|
}
|