You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/advanced/authentication.md
+34-2Lines changed: 34 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Authentication
2
2
3
-
Coilpack comes with it's own Authentication Guard for Laravel so that you can retrieve the active ExpressionEngine member as an Eloquent Model with the following code:
3
+
Coilpack comes with it's own Authentication Guard for Laravel so that you can retrieve the active ExpressionEngine Member as an Eloquent model with the following code:
4
4
5
5
```php
6
6
auth('coilpack')->user()
@@ -21,4 +21,36 @@ We are not making any assumptions about your setup and so the `'coilpack'` guard
21
21
22
22
This can simplify your authentication calls to look like the standard `auth()->user()`.
23
23
24
-
For more information on [Laravel's Authentication](https://laravel.com/docs/9.x/authentication) capabilities please review their documentation.
24
+
For more information on [Laravel's Authentication](https://laravel.com/docs/9.x/authentication) capabilities please review their documentation.
25
+
26
+
## Custom Member Model
27
+
28
+
The Eloquent model used by Coilpack's authentication guard can be extended to add functionality and other customizations.
29
+
30
+
Instead of starting with a blank Eloquent model we recommend that you extend the included Member model `Expressionengine\Coilpack\Models\Member\Member`
31
+
32
+
Your custom model might look like this:
33
+
```php
34
+
# app/Models/Member.php
35
+
<?php
36
+
37
+
namespace App\Models;
38
+
39
+
use Expressionengine\Coilpack\Models\Member\Member as BaseMember;
40
+
41
+
class Member extends BaseMember
42
+
{
43
+
44
+
}
45
+
```
46
+
47
+
Coilpack doesn't know about this custom model until you update the `member_model` setting in your `config/coilpack.php`.
0 commit comments