diff --git a/passport.md b/passport.md index e8acd030585..af0c7f24dc1 100644 --- a/passport.md +++ b/passport.md @@ -25,6 +25,7 @@ - [Passing The Access Token](#passing-the-access-token) - [Token Scopes](#token-scopes) - [Defining Scopes](#defining-scopes) + - [Default Scope](#default-scope) - [Assigning Scopes To Tokens](#assigning-scopes-to-tokens) - [Checking Scopes](#checking-scopes) - [Consuming Your API With JavaScript](#consuming-your-api-with-javascript) @@ -654,6 +655,15 @@ You may define your API's scopes using the `Passport::tokensCan` method in the ` 'check-status' => 'Check order status', ]); + +### Default Scope + +If a client decides to omit the scope the server still choose to set a default scope. You can achieve setting a default scope by using the `setDefaultScope`. Values need to be separated with a space or be passed as an array: + + use Laravel\Passport\Passport; + + Passport::setDefaultScope('place-orders check-status'); + ### Assigning Scopes To Tokens