diff --git a/app/Filament/Pages/Settings/GeneralPage.php b/app/Filament/Pages/Settings/GeneralPage.php index 92b273e08..501504527 100644 --- a/app/Filament/Pages/Settings/GeneralPage.php +++ b/app/Filament/Pages/Settings/GeneralPage.php @@ -2,6 +2,7 @@ namespace App\Filament\Pages\Settings; +use App\Rules\ValidCronExpression; use App\Settings\GeneralSettings; use Filament\Forms\Components\Card; use Filament\Forms\Components\Grid; @@ -64,6 +65,7 @@ protected function getFormSchema(): array Section::make('Speedtest Settings') ->schema([ TextInput::make('speedtest_schedule') + ->rules([new ValidCronExpression()]) ->helperText('Leave empty to disable the schedule. You can also use the cron expression generator [HERE](https://crontab.cronhub.io/) to help you make schedules.') ->nullable() ->columnSpan(1), diff --git a/app/Rules/ValidCronExpression.php b/app/Rules/ValidCronExpression.php new file mode 100644 index 000000000..9ebb48d16 --- /dev/null +++ b/app/Rules/ValidCronExpression.php @@ -0,0 +1,26 @@ +