Added settings section and custom cron scheduling

This commit is contained in:
Henry Whitaker
2020-05-19 01:08:35 +01:00
parent e889a4f487
commit 2a5fd76c42
14 changed files with 288 additions and 11 deletions

41
app/Rules/Cron.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
namespace App\Rules;
use Cron\CronExpression;
use Illuminate\Contracts\Validation\Rule;
class Cron implements Rule
{
/**
* Create a new rule instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
return CronExpression::isValidExpression($value);
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
return 'The :attribute field must be a valid cron expression.';
}
}