Lae/app/Http/Requests/User/WorkOrder/WorkOrderRequest.php

33 lines
614 B
PHP

<?php
namespace App\Http\Requests\User\WorkOrder;
use Illuminate\Foundation\Http\FormRequest;
class WorkOrderRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize(): bool
{
$work_order = $this->route('workOrder');
return $work_order->user_id == auth()->id();
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, mixed>
*/
public function rules(): array
{
return [
//
];
}
}