32 lines
764 B
PHP
32 lines
764 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\V3\RoadObservation;
|
|
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
class VerifyBySupervisorRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return Gate::allows('gate-supervise-road-observed', $this->roadObserved);
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, ValidationRule|array|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'verify' => ['required', 'in:1,2'],
|
|
'description' => ['string'],
|
|
];
|
|
}
|
|
}
|