@@ -20,10 +20,10 @@ User Authentication
20
20
Overview
21
21
--------
22
22
23
- In this guide, you can learn how to authenticate users stored in MongoDB
23
+ In this guide, you can learn how to authenticate MongoDB users
24
24
by using Laravel's native authentication functionality.
25
25
26
- Laravel provides a native Auth module that includes authentication services,
26
+ Laravel provides a native `` Auth`` module that includes authentication services,
27
27
such as guards that define how users are authenticated and providers that define
28
28
how users are retrieved. To learn more about these services, see `Authentication
29
29
<https://laravel.com/docs/{+laravel-docs-version+}/authentication>`__ in the
@@ -33,18 +33,19 @@ Modify the User Model
33
33
---------------------
34
34
35
35
By default, Laravel generates the ``User`` Eloquent model in your ``App/Models``
36
- directory. To enable authentication for users stored in MongoDB, your ``User`` model
36
+ directory. To enable authentication for MongoDB users , your ``User`` model
37
37
must extend the ``MongoDB\Laravel\Auth\User`` class.
38
38
39
39
To extend this class, navigate to your ``app/Models/User.php`` file and replace the
40
- ``use Illuminate\Foundation\Auth\User as Authenticatable`` use statement with the following
40
+ ``use Illuminate\Foundation\Auth\User as Authenticatable`` statement with the following
41
41
code:
42
42
43
43
.. code-block:: php
44
44
45
45
use MongoDB\Laravel\Auth\User as Authenticatable;
46
46
47
- Ensure that your ``User`` class extends ``Authenticatable``, as shown in the following code:
47
+ Next, ensure that your ``User`` class extends ``Authenticatable``, as shown in the following
48
+ code:
48
49
49
50
.. code-block:: php
50
51
@@ -53,13 +54,13 @@ Ensure that your ``User`` class extends ``Authenticatable``, as shown in the fol
53
54
...
54
55
}
55
56
56
- After configuring your ``User`` model, create a corresponding controller. For instructions on
57
- creating a controller, see the :ref:`laravel-auth-controller` section on this page.
57
+ After configuring your ``User`` model, create a corresponding controller. To learn how to
58
+ create a controller, see the :ref:`laravel-auth-controller` section on this page.
58
59
59
60
Example
60
61
~~~~~~~
61
62
62
- The following code demonstrates a ``User.php`` file that extends the ``MongoDB\Laravel\Auth\User``
63
+ The following code shows a ``User.php`` file that extends the ``MongoDB\Laravel\Auth\User``
63
64
class:
64
65
65
66
.. literalinclude:: /includes/auth/AuthUser.php
0 commit comments