<?php

namespace App\Http\Requests\Gatepass;

use Illuminate\Foundation\Http\FormRequest;

class StoreGatepassRequest extends FormRequest
{
	public function authorize(): bool { return true; }
	public function rules(): array
	{
		return [
			'gate_pass_number'=>['required','string','max:255','unique:gate_passes,gate_pass_number'],
			// 'contact_id'=>['required','integer','exists:contacts,id'],
			'purchase_order_id'=>['required','integer','exists:purchase_orders,id'],
			'date'=>['required','date'],
			'type'=>['required','in:inbound,outbound'],
			'vehicle_no'=>['required','string','max:255'],
			'driver_name'=>['nullable','string','max:255'],
			'other_persons'=>['nullable','string'],
			'remarks'=>['nullable','string']
		];
	}
}
