|
11 | 11 | - [Introduction](#introduction) |
12 | 12 | - [Installation](#installation) |
13 | 13 | - Usage |
| 14 | + - [User Configuration](#user-configuration) |
14 | 15 | - [Visit Monitoring](#visit-monitoring) |
15 | 16 | - [Delete Visit Monitoring Records By Specific Days](#delete-visit-monitoring-records-by-specific-days) |
16 | 17 | - [Turn ON-OFF](#turn-on-off) |
@@ -64,6 +65,47 @@ php artisan vendor:publish --provider="Binafy\LaravelUserMonitoring\Providers\La |
64 | 65 |
|
65 | 66 | After publishing, run `php artisan migrate` command. |
66 | 67 |
|
| 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 | + |
67 | 109 | <a name="visit-monitoring"></a> |
68 | 110 | ## Visit Monitoring |
69 | 111 |
|
|
0 commit comments