| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace App\Http\Requests\Order;
- use Illuminate\Foundation\Http\FormRequest;
- class StoreOrderRequest extends FormRequest
- {
- /**
- * Determine if the user is authorized to make this request.
- */
- public function authorize(): bool
- {
- return auth()->check();
- }
- /**
- * Get the validation rules that apply to the request.
- *
- * @return array
- */
- public function rules(): array
- {
- return [
- 'id' => 'nullable|exists:orders,id',
- 'user_id' => 'required|exists:users,id',
- 'district_id' => 'required|exists:districts,id',
- 'area_id' => 'required|exists:areas,id',
- 'object_address' => 'required|string|min:5',
- 'object_type_id' => 'required|exists:object_types,id',
- 'contract_date' => 'nullable|date',
- 'contract_number' => 'nullable|string',
- 'comment' => 'nullable|string',
- 'installation_date' => 'nullable|date',
- 'brigadier_id' => 'nullable|exists:users,id',
- 'tg_group_name' => 'nullable|string',
- 'tg_group_link' => 'nullable|string',
- 'products' => 'nullable|array',
- 'quantity' => 'nullable|array',
- 'products_sku' => 'nullable|array',
- ];
- }
- }
|