This commit is contained in:
root
2023-03-29 15:20:05 +00:00
parent 5ec489e0e0
commit a0bb8f2d1e
25468 changed files with 3063105 additions and 28 deletions

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 value is a valid CRON expression
*
* @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.';
}
}

View File

@@ -0,0 +1,41 @@
<?php
namespace App\Rules;
use Hash;
use Illuminate\Contracts\Validation\Rule;
class CurrentPasswordMatches 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 Hash::check($value, auth()->user()->password);
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
return 'The current password doesn\'t match.';
}
}