Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Http\Requests;
  4.  
  5. use Illuminate\Foundation\Http\FormRequest;
  6.  
  7. class StoreBlog extends FormRequest
  8. {
  9. /**
  10. * Determine if the user is authorized to make this request.
  11. *
  12. * @return bool
  13. */
  14. public function authorize()
  15. {
  16. return true;
  17. }
  18.  
  19. /**
  20. * Get the validation rules that apply to the request.
  21. *
  22. * @return array
  23. */
  24. public function rules()
  25. {
  26. return [
  27. 'title' => 'required',
  28. 'photo' => 'required|image|max:800',
  29. 'position' => 'required|integer',
  30. 'category' => 'required',
  31. 'description' => 'required|min:300',
  32. ];
  33. }
  34.  
  35. public function messages()
  36. {
  37. return [
  38. 'title.required' => 'Pole <strong>tytuł bloga</strong> jest wymagane!',
  39. 'photo.required' => 'Pole <strong>zdjęcie wpisu</strong> jest wymagane!',
  40. 'photo.image' => 'Pole <strong>zdjęcie wpisu</strong> musi być musi być obrazem w formacie (jpeg, png, bmp, gif, or svg)!!',
  41. 'photo.max' => 'Pole <strong>zdjęcie wpisu</strong> nie może być większe niż 800KB!',
  42. 'position.required' => 'Pole <strong>pozycja wyświetlania</strong> jest wymagane!',
  43. 'position.integer' => 'Pole <strong>pozycja wyświetlania</strong> musi być wartością liczbową!',
  44. 'category.required' => 'Pole <strong>kategoria</strong> jest wymagane!',
  45. 'description.required' => 'Pole <strong>treść bloga</strong> jest wymagane!',
  46. 'description.min' => 'Pole <strong>treść bloga</strong> musi mieć co najmniej 300 znaków!',
  47. ];
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement