ProductSKUStoreRequest.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App\Http\Requests;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class ProductSKUStoreRequest 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. 'product_id' => 'required|exists:products,id',
  22. 'order_id' => 'nullable|exists:orders,id',
  23. 'status' => 'nullable|string',
  24. 'rfid' => 'nullable|string',
  25. 'factory_number' => 'nullable|string',
  26. 'manufacture_date' => 'nullable|date',
  27. 'service_life' => 'nullable|integer',
  28. 'certificate_number' => 'nullable|string',
  29. 'certificate_date' => 'nullable|date',
  30. 'certificate_issuer' => 'nullable|string',
  31. 'certificate_type' => 'nullable|string',
  32. 'statement_number' => 'nullable|string',
  33. 'statement_date' => 'nullable|date',
  34. 'upd_number' => 'nullable|string',
  35. 'comment' => 'nullable|string',
  36. ];
  37. }
  38. }