@@ -164,6 +164,16 @@ Laravel Passport is an OAuth 2.0 server implementation that offers
164
164
API authentication for Laravel applications. Use Laravel Passport if
165
165
your application requires OAuth2 support.
166
166
167
+ .. tip::
168
+
169
+ To learn more about Laravel Passport and the OAuth 2.0 protocol, see
170
+ the following resources:
171
+
172
+ - `Laravel Passport <https://laravel.com/docs/{+laravel-docs-version+}/passport>`__ in the
173
+ Laravel documentation.
174
+
175
+ - `OAuth 2.0 <https://oauth.net/2/>`__ on the OAuth website.
176
+
167
177
Install Laravel Passport
168
178
````````````````````````
169
179
@@ -201,14 +211,13 @@ API requests. The following example adds the ``api`` authentication guard
201
211
to the ``guards`` array:
202
212
203
213
.. code-block:: php
204
- :emphasize-lines: 7-10
214
+ :emphasize-lines: 6-9
205
215
206
216
'guards' => [
207
217
'web' => [
208
218
'driver' => 'session',
209
219
'provider' => 'users',
210
220
],
211
-
212
221
'api' => [
213
222
'driver' => 'passport',
214
223
'provider' => 'users',
@@ -229,8 +238,8 @@ You can define the following {+odm-short+} model classes:
229
238
- ``MongoDB\Laravel\Passport\RefreshToken``, which extends ``Laravel\Passport\RefreshToken``
230
239
- ``MongoDB\Laravel\Passport\Token``, which extends ``Laravel\Passport\Token``
231
240
232
- For example, the following code overrides the default ``Laravel\Passport\AuthCode``
233
- model class by defining a ``MongoDB\Laravel\Passport\AuthCode`` class and including
241
+ The following example code extends the default ``Laravel\Passport\AuthCode``
242
+ model class when defining a ``MongoDB\Laravel\Passport\AuthCode`` class and includes
234
243
the ``DocumentModel`` trait:
235
244
236
245
.. code-block:: php
@@ -243,9 +252,10 @@ the ``DocumentModel`` trait:
243
252
protected $keyType = 'string';
244
253
}
245
254
246
- After defining each custom model, instruct Passport to use the models in the ``boot()``
247
- method of your application's ``App\Providers\AppServiceProvider`` class, as shown
248
- in the following code:
255
+ After defining custom models that extend each ``Laravel\Passport`` class, instruct
256
+ Passport to use the models in the ``boot()`` method of your application's
257
+ ``App\Providers\AppServiceProvider`` class. The following example adds each custom
258
+ model to the ``boot()`` method:
249
259
250
260
.. literalinclude:: /includes/auth/AppServiceProvider.php
251
261
:language: php
0 commit comments