amber-laravel/app/Http/Requests/AssistantRequest.php

35 lines
714 B
PHP
Raw Normal View History

2024-07-24 08:13:16 +00:00
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class AssistantRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
$assistant = $this->route('assistant');
if ($assistant && $assistant->user_id === $this->user('api')->id) {
return true;
}
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
//
];
}
}