Skip to content

Commit 26bf692

Browse files
committed
add User Configuration section into README
1 parent 7a3fc4b commit 26bf692

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- [Introduction](#introduction)
1212
- [Installation](#installation)
1313
- Usage
14+
- [User Configuration](#user-configuration)
1415
- [Visit Monitoring](#visit-monitoring)
1516
- [Delete Visit Monitoring Records By Specific Days](#delete-visit-monitoring-records-by-specific-days)
1617
- [Turn ON-OFF](#turn-on-off)
@@ -64,6 +65,47 @@ php artisan vendor:publish --provider="Binafy\LaravelUserMonitoring\Providers\La
6465

6566
After publishing, run `php artisan migrate` command.
6667

68+
<a name="user-configuration"></a>
69+
## User Configuration
70+
71+
You can config your user with `user-monitoring.php` configuration file:
72+
73+
```php
74+
'user' => [
75+
/*
76+
* User model.
77+
*/
78+
'model' => 'App\Models\User',
79+
80+
/*
81+
* Foreign Key column name.
82+
*/
83+
'foreign_key' => 'user_id',
84+
85+
/*
86+
* Users table name.
87+
*/
88+
'table' => 'users',
89+
90+
/*
91+
* The correct guard.
92+
*/
93+
'guard' => 'web',
94+
95+
/*
96+
* If you are using uuid or ulid you can change it for type of foreign_key.
97+
*
98+
* When you are using ulid or uuid, you need to add related trait into the models.
99+
*/
100+
'foreign_key_type' => 'id', // uuid, ulid, id
101+
],
102+
```
103+
104+
- `model`: If your user model is exists in another place, you can change it to correct namespace.
105+
- `foreign_key`: You can set the user foreign_key name, like `customer_id`.
106+
- `table`: You can write your users table name if is not `users.
107+
- `guard`: The correct guard that using for user.
108+
67109
<a name="visit-monitoring"></a>
68110
## Visit Monitoring
69111

0 commit comments

Comments
 (0)