Lae/app/Http/Requests/Remote/WorkOrderRequest.php

32 lines
649 B
PHP
Raw Normal View History

2022-08-15 11:10:51 +00:00
<?php
namespace App\Http\Requests\Remote;
2022-08-15 14:29:57 +00:00
use App\Models\WorkOrder\WorkOrder;
2022-08-15 11:10:51 +00:00
use Illuminate\Foundation\Http\FormRequest;
class WorkOrderRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
2022-08-15 14:29:57 +00:00
return WorkOrder::where('id', $this->route('work_order')->id)->where('module_id', auth('remote')->id())->exists();
2022-08-15 11:10:51 +00:00
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, mixed>
*/
public function rules()
{
return [
//
];
}
}