Advertisement
kecsot

Validáció

Jul 2nd, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Http\Requests;
  4.  
  5. use App\Http\Requests\Request;
  6.  
  7. class AddFoodRequest extends Request
  8. {
  9. public function rules()
  10. {
  11. return [
  12. 'foodName' => 'required|Between:3,45',
  13. 'price' => 'required'
  14. ];
  15. }
  16.  
  17. public function messages()
  18. {
  19. return [
  20. 'foodName.unique'=>'Már van ilyen kategória!',
  21. 'foodName.required'=>'Kötelező megadni a kategória nevét!',
  22. 'foodName.between'=>'A termék neve minimum :min és maximum :max karakter!',
  23. 'price.required'=>'Kötelező megadni a termék árát!',
  24. ];
  25. }
  26.  
  27. public function authorize()
  28. {
  29. return true;
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement