34 lines
1.1 KiB
PHP
34 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Request;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreServiceRequestRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'title' => ['required', 'string', 'max:255'],
|
|
'description' => ['required', 'string'],
|
|
'type_id' => ['required', 'exists:request_types,id'],
|
|
'priority_id' => ['required', 'exists:priorities,id'],
|
|
'status_id' => ['nullable', 'exists:statuses,id'],
|
|
'client_id' => ['required', 'exists:users,id'],
|
|
'assigned_to' => ['nullable', 'exists:users,id'],
|
|
'equipment_id' => ['nullable', 'exists:equipment,id'],
|
|
'location' => ['nullable', 'string', 'max:255'],
|
|
'planned_at' => ['nullable', 'date'],
|
|
'deadline_at' => ['nullable', 'date'],
|
|
'resolution_notes' => ['nullable', 'string'],
|
|
'attachments' => ['nullable', 'array', 'max:5'],
|
|
'attachments.*' => ['file', 'max:10240'],
|
|
];
|
|
}
|
|
}
|