File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
use Illuminate \Support \ServiceProvider ;
6
6
use MongoDB \Laravel \Passport \AuthCode ;
7
+ use MongoDB \Laravel \Passport \Client ;
8
+ use MongoDB \Laravel \Passport \PersonalAccessClient ;
9
+ use MongoDB \Laravel \Passport \RefreshToken ;
10
+ use MongoDB \Laravel \Passport \Token ;
7
11
8
12
class AppServiceProvider extends ServiceProvider
9
13
{
@@ -20,5 +24,9 @@ public function register(): void
20
24
public function boot (): void
21
25
{
22
26
Passport::useAuthCodeModel (AuthCode::class);
27
+ Passport::useClientModel (Client::class);
28
+ Passport::usePersonalAccessClientModel (PersonalAccessClient::class);
29
+ Passport::useRefreshTokenModel (RefreshToken::class);
30
+ Passport::useTokenModel (Token::class);
23
31
}
24
32
}
Original file line number Diff line number Diff line change @@ -243,13 +243,13 @@ the ``DocumentModel`` trait:
243
243
protected $keyType = 'string';
244
244
}
245
245
246
- After defining a custom model, instruct Passport to use the model in the ``boot``
246
+ After defining each custom model, instruct Passport to use the models in the ``boot() ``
247
247
method of your application's ``App\Providers\AppServiceProvider`` class, as shown
248
248
in the following code:
249
249
250
250
.. literalinclude:: /includes/auth/AppServiceProvider.php
251
251
:language: php
252
- :emphasize-lines: 6,22
252
+ :emphasize-lines: 26-30
253
253
:dedent:
254
254
255
255
You can now use Laravel Passport and MongoDB in your application. For more information, see
You can’t perform that action at this time.
0 commit comments