fix
This commit is contained in:
		
							
								
								
									
										29
									
								
								app/Infrastructure/Http/Requests/TechnologyRequest.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								app/Infrastructure/Http/Requests/TechnologyRequest.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| <?php | ||||
|  | ||||
| declare(strict_types=1); | ||||
|  | ||||
| namespace Toby\Infrastructure\Http\Requests; | ||||
|  | ||||
| use Illuminate\Foundation\Http\FormRequest; | ||||
| use Illuminate\Validation\Rule; | ||||
|  | ||||
| class TechnologyRequest extends FormRequest | ||||
| { | ||||
|     public function rules(): array | ||||
|     { | ||||
|         return [ | ||||
|             "name" => [ | ||||
|                 "required", | ||||
|                 Rule::unique("technologies", "name")->ignore($this->technology), | ||||
|                 "max:255", | ||||
|             ], | ||||
|         ]; | ||||
|     } | ||||
|  | ||||
|     public function data(): array | ||||
|     { | ||||
|         return [ | ||||
|             "name" => $this->get("name"), | ||||
|         ]; | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user