more fixes
This commit is contained in:
31
app/Http/Requests/Settings/VerifyEmailChangeRequest.php
Normal file
31
app/Http/Requests/Settings/VerifyEmailChangeRequest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Requests\Settings;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class VerifyEmailChangeRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
if ($this->has('code')) {
|
||||
$this->merge([
|
||||
'code' => preg_replace('/\D+/', '', (string) $this->input('code')),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'code' => ['required', 'digits:6'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user