Mercurial > borealpoint
comparison app/Http/Requests/ProfileUpdateRequest.php @ 0:9d7dcd54c677
Initial Commit and package setup
| author | luka |
|---|---|
| date | Sat, 23 Aug 2025 22:20:51 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:9d7dcd54c677 |
|---|---|
| 1 <?php | |
| 2 | |
| 3 namespace App\Http\Requests; | |
| 4 | |
| 5 use App\Models\User; | |
| 6 use Illuminate\Foundation\Http\FormRequest; | |
| 7 use Illuminate\Validation\Rule; | |
| 8 | |
| 9 class ProfileUpdateRequest extends FormRequest | |
| 10 { | |
| 11 /** | |
| 12 * Get the validation rules that apply to the request. | |
| 13 * | |
| 14 * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> | |
| 15 */ | |
| 16 public function rules(): array | |
| 17 { | |
| 18 return [ | |
| 19 'name' => ['required', 'string', 'max:255'], | |
| 20 'email' => [ | |
| 21 'required', | |
| 22 'string', | |
| 23 'lowercase', | |
| 24 'email', | |
| 25 'max:255', | |
| 26 Rule::unique(User::class)->ignore($this->user()->id), | |
| 27 ], | |
| 28 ]; | |
| 29 } | |
| 30 } |
