ProductRequestEdit.php 828 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Packages\Product\Http\Requests;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. use Illuminate\Validation\Rule;
  5. class ProductRequest extends FormRequest
  6. {
  7. /**
  8. * Determine if the user is authorized to make this request.
  9. *
  10. * @return bool
  11. */
  12. public function authorize()
  13. {
  14. return true;
  15. }
  16. /**
  17. * Get the validation rules that apply to the request.
  18. *
  19. * @return array
  20. */
  21. public function rules()
  22. {
  23. // dd(request()->all());
  24. return [
  25. 'title' => ['required','max:100'],
  26. 'price' => 'required',
  27. 'type' => ['required'],
  28. 'status' => ['required'],
  29. 'discription' => ['required'],
  30. 'categories' => ['required'],
  31. 'photo' => ['required'],
  32. ];
  33. }
  34. }