ldc-gen-game-web/app/Http/Requests/Fo/AuthenticateRequest.php

38 lines
781 B
PHP
Raw Normal View History

2022-03-15 16:27:41 +01:00
<?php
namespace App\Http\Requests\Fo;
use App\Lib\ToolboxHelper;
use Illuminate\Foundation\Http\FormRequest;
class AuthenticateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize()
{
$this->merge([
'remember' => $this->remember ? true : false
]);
return ToolboxHelper::isLoginAccessAllowed();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'email' => 'required|email:rfc,dns,spoof,filter',
'password' => 'required',
'remember' => 'required|boolean'
];
}
}