31 lines
701 B
PHP
31 lines
701 B
PHP
<?php
|
|
|
|
namespace App\User\Requests\Auth;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class LoginRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'name' => 'required_without:email|exists:users,name',
|
|
'email' => 'required_without:name|email|exists:users,email',
|
|
'password' => 'required|string|regex:/^(?=.*[a-zA-Z])(?=.*\d).+$/|min:8',
|
|
];
|
|
}
|
|
}
|