StoreProductRequest.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace App\Http\Requests;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class StoreProductRequest extends FormRequest
  5. {
  6. /**
  7. * Determine if the user is authorized to make this request.
  8. */
  9. public function authorize(): bool
  10. {
  11. return auth()->check();
  12. }
  13. /**
  14. * Get the validation rules that apply to the request.
  15. *
  16. * @return array
  17. */
  18. public function rules(): array
  19. {
  20. return [
  21. 'article' => 'required|string',
  22. 'name_tz' => 'required|string',
  23. 'type_tz' => 'required|string',
  24. 'nomenclature_number' => 'required|string',
  25. 'sizes' => 'required|string',
  26. 'manufacturer' => 'required|string',
  27. 'unit' => 'required|string',
  28. 'type' => 'required|string',
  29. 'product_price' => 'required|numeric',
  30. 'installation_price' => 'required|numeric',
  31. 'total_price' => 'required|numeric',
  32. 'manufacturer_name' => 'required|string',
  33. 'note' => 'nullable|string',
  34. 'passport_name' => 'nullable|string',
  35. 'statement_name' => 'nullable|string',
  36. 'service_life' => 'nullable|string',
  37. 'certificate_number' => 'nullable|string',
  38. 'certificate_date' => 'nullable|string',
  39. 'certificate_issuer' => 'nullable|string',
  40. 'certificate_type' => 'nullable|string',
  41. 'weight' => 'nullable|numeric',
  42. 'volume' => 'nullable|nullable',
  43. 'places' => 'nullable|integer',
  44. ];
  45. }
  46. }