Files
backend/app/Http/Requests/V3/Mission/TransportaionUnit/AllocateRequest.php

30 lines
745 B
PHP

<?php
namespace App\Http\Requests\V3\Mission\TransportaionUnit;
use Illuminate\Foundation\Http\FormRequest;
class AllocateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return $this->mission->edare_shahri_id == auth()->user()->edarate_shahri_id;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'machines' => 'required|array',
'machines.*' => 'required|integer|exists:cmms_machines,id',
];
}
}