37 lines
842 B
PHP
37 lines
842 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Requests;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
use Illuminate\Support\Facades\Session;
|
||
|
|
|
||
|
|
class EmployeeResetPasswordRequest extends FormRequest
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Determine if the user is authorized to make this request.
|
||
|
|
*
|
||
|
|
* @return bool
|
||
|
|
*/
|
||
|
|
public function authorize()
|
||
|
|
{
|
||
|
|
return Session::has('resetMail');
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the validation rules that apply to the request.
|
||
|
|
*
|
||
|
|
* @return array
|
||
|
|
*/
|
||
|
|
public function rules()
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'newpassword' => [
|
||
|
|
'required',
|
||
|
|
'string',
|
||
|
|
'regex:/^(?=.*[A-Z])(?=.*[²&~"#\'\{\(\[\-|`_\\^@\)\°=+\}¨^$£¤%?,;.:\/!§*<>])(?=.*[0-9].*)(?=.*[a-z]).{8,}$/'
|
||
|
|
],
|
||
|
|
'newpasswordConfirm' => 'required|same:newpassword'
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|