Last active
October 27, 2023 22:25
-
-
Save innovacode-online/d0cbf9a842fb5c1ef26240c700178943 to your computer and use it in GitHub Desktop.
Product request for inventory project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function rules(): array | |
{ | |
return [ | |
'name' => 'required|unique:products,name', | |
'description' => 'required', | |
'stock' => 'required', | |
'price' => 'required', | |
'category_id' => 'required', | |
]; | |
} | |
public function messages() | |
{ | |
return [ | |
'name.required' => 'Se requiere el nombre', | |
'name.unique' => 'Ya existe un producto con este nombre', | |
'description.required' => 'Debe agregar una descripcion', | |
'category_id.required' => 'Debe asignar una categoria', | |
'stock.required' => 'Debe agregar una cantidad de stock', | |
'price.required' => 'Debe añadir un precio', | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment