You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to get a route parameter via a FormRequest's route() function generate an erroneous warning, I believe the extension thinks the code is trying to use Laravel's global route() helper.
Mimimal Code Sample
// routes/api.php
Route::apiResource('/clients', ClientController::class);
// app/Http/Controllers/ClientController.phppublicfunctionshow(ClientShowRequest$request, Client$client)
{
return$client;
}
// app/Http/Requests/ClientShowRequest.phpclass ClientShowRequest extends FormRequest
{
/** * Determine if the user is authorized to make this request. */publicfunctionauthorize(): bool
{
$client = $this->route('client');
return$this->user()->can('viewClient', $client);
}
/** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> */publicfunctionrules(): array
{
return [
//
];
}
}
The text was updated successfully, but these errors were encountered:
Extension Version
0.1.18
PHP Binary
Docker
Operating System
Windows
What happened?
Trying to get a route parameter via a FormRequest's route() function generate an erroneous warning, I believe the extension thinks the code is trying to use Laravel's global route() helper.
Mimimal Code Sample
The text was updated successfully, but these errors were encountered: