Mercurial > packages > auth
diff stubs/default/app/Http/Requests/ProfileUpdateRequest.php @ 0:90e38de8f2ba
Initial Commit
| author | luka |
|---|---|
| date | Wed, 13 Aug 2025 22:17:20 -0400 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stubs/default/app/Http/Requests/ProfileUpdateRequest.php Wed Aug 13 22:17:20 2025 -0400 @@ -0,0 +1,30 @@ +<?php + +namespace App\Http\Requests; + +use App\Models\User; +use Illuminate\Foundation\Http\FormRequest; +use Illuminate\Validation\Rule; + +class ProfileUpdateRequest extends FormRequest +{ + /** + * Get the validation rules that apply to the request. + * + * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> + */ + public function rules(): array + { + return [ + 'name' => ['required', 'string', 'max:255'], + 'email' => [ + 'required', + 'string', + 'lowercase', + 'email', + 'max:255', + Rule::unique(User::class)->ignore($this->user()->id), + ], + ]; + } +}
