26 lines
784 B
PHP
26 lines
784 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Api\V1\Wash;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class StartWashRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'machine_uuid' => ['required_without:qr_code', 'nullable', 'uuid', 'exists:machines,uuid'],
|
|
'qr_code' => ['required_without:machine_uuid', 'nullable', 'string', 'max:255', 'exists:machines,qr_code'],
|
|
'booking_uuid' => ['nullable', 'uuid', 'exists:bookings,uuid'],
|
|
'trigger_method' => ['required', Rule::in(['qr_code', 'booking', 'supervisor', 'system'])],
|
|
'program' => ['nullable', 'string', 'max:100'],
|
|
];
|
|
}
|
|
}
|