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: README.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,6 +101,50 @@ If you want to disable monitoring for specific pages you can go to `user-monitor
101
101
],
102
102
```
103
103
104
+
### Delete Visit Monitoring Records By Specific Days
105
+
106
+
You may to delete records by specific days, Laravel-User-Monitoring also support this 🤩.
107
+
108
+
First, you need go to `user-monitoring` config file and highlighting the days that you want to delete:
109
+
110
+
```php
111
+
'visit_monitoring' => [
112
+
...
113
+
114
+
/*
115
+
* If you want to delete visit rows after some days, you can change this like 360,
116
+
* but you don't like to delete rows you can change it to 0.
117
+
*
118
+
* For this feature you need Task-Scheduling => https://laravel.com/docs/10.x/scheduling
119
+
*/
120
+
'delete_days' => 10,
121
+
],
122
+
```
123
+
124
+
After, you need to use [Task Scheduling](https://laravel.com/docs/10.x/scheduling) to fire related command, so go to `app/Console/Kernel.php` and do like this:
125
+
126
+
```php
127
+
<?php
128
+
129
+
namespace App\Console;
130
+
131
+
...
132
+
use Binafy\LaravelUserMonitoring\Commands\RemoveVisitMonitoringRecordsCommand;
133
+
134
+
class Kernel extends ConsoleKernel
135
+
{
136
+
/**
137
+
* Define the application's command schedule.
138
+
*/
139
+
protected function schedule(Schedule $schedule): void
You can change `hourly` to `minute` or `second`, for more information you can read [Schedule Frequency Options](https://laravel.com/docs/10.x/scheduling#schedule-frequency-options).
0 commit comments