plugin icon indicating copy to clipboard operation
plugin copied to clipboard

[Feature Request]: Allow autocompletion of Passport scope name

Open bram-pkg opened this issue 1 year ago • 0 comments

Feature Description

Scopes are defines as such:

class AppServiceProvider extends ServiceProvider {
    public function boot(): void
    {
        Laravel\Passport\Passport::tokensCan([
            'my-scope' => 'Scope description',
        ]);
    }
}```

It would be great if we could allow for autocompletion of this in the default places where you use scopes, for example the `CheckClientCredentials::using($scopes)` middleware.

Allowing scope autocompletion to be added using the `ide.json` would also be really useful.

```json
{
    "$schema": "https://laravel-ide.com/schema/laravel-ide-v2.json",
    "completions": [
        {
            "complete": "passportScopeId",
            "condition": [
                {
                    "classFqn": ["\\App\\Http\\Middleware\\Auth\\EnsureScope"],
                    "methodNames": ["using"],
                    "parameters": [1]
                }
            ]
        }
    ]
}

bram-pkg avatar Feb 29 '24 12:02 bram-pkg