mirror of
				https://github.com/anna-sara/filament_inventory
				synced 2025-10-27 09:07:14 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
	
		
			743 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
	
		
			743 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?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),
 | |
|             ],
 | |
|         ];
 | |
|     }
 | |
| }
 |