osb/app/Http/Requests/UserEdit.php
Deon George b1067e1378
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 1m14s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s
Added Passkey login, fixed password reset as a result of updating laravel
2024-07-23 00:13:54 +10:00

39 lines
958 B
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\Rules\Password;
class UserEdit extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return Auth::id() === $this->route('o')->id;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'email'=>'required|email|min:5',
'password'=>['nullable','confirmed',Password::min(8)],
'firstname'=>'required|min:2',
'lastname'=>'required|min:2',
'address1'=>'required|min:8',
'address2'=>'nullable|min:8',
'city'=>'required|min:4',
'state'=>'required|min:3|max:3',
'postcode'=>'required|min:4|max:4',
'country_id'=>'required|exists:countries,id'
];
}
}