user(); return auth()->check() and $user->isAdmin(); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { return [ 'status' => [ 'required', // @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed function ($attribute, $value, $fail) { if (!in_array($value, TicketStatusEnum::toValues())) { $fail(__('Veuillez choisir entre :values', [ 'value' => implode(',', TicketStatusEnum::toLabels()) ])); } } ], ]; } }