32 lines
658 B
PHP
32 lines
658 B
PHP
<?php
|
|
|
|
namespace App\Domains\Auth\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Support\Str;
|
|
|
|
class AdminAppCreateResetPasswordAttemptRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
protected function prepareForValidation(): void
|
|
{
|
|
$email = $this->input('email');
|
|
|
|
if (is_string($email)) {
|
|
$this->merge(['email' => Str::lower(trim($email))]);
|
|
}
|
|
}
|
|
|
|
/** @return array<string, mixed> */
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'email' => ['required', 'string', 'email', 'max:255'],
|
|
];
|
|
}
|
|
}
|