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
This package is use to save all activities of user build for dashboard.
3
2
3
+
This package is only for Laravel >=8 Framework.
4
4
5
-
On the root of your project just run the below command and download this DIR and paste in activitylog folder. We don't have any package so you have to do it manually.
5
+
<details>
6
+
<summary>Manual installation process.</summary>
7
+
8
+
On the root of your project just run the below command download this DIR and paste it into the activitylog folder. We don't have any package so you have to do it manually.
6
9
7
10
````
8
11
mkdir -p packages/lcw/activitylog
9
12
````
13
+
After copying, the code goes to that directory and updates the composer for that use below command.
14
+
15
+
16
+
````
17
+
cd packages/lcw/activitylog/
18
+
composer dump-autoload
19
+
````
20
+
Simple use Just add the below line in your root composer.json in the autoload section.
10
21
11
-
Simple use just adds the below line in your root `composer.json` in autoload section.
The composer.json must look like the below after adding the like.
16
27
17
-
The `composer.json` must look like the below after adding the like.
18
28
19
29
````
20
30
"autoload": {
@@ -26,15 +36,43 @@ The `composer.json` must look like the below after adding the like.
26
36
}
27
37
},
28
38
````
29
-
30
39
After adding run the below command to load the package in your composer.
31
40
41
+
42
+
43
+
````composer dump-autoload````
44
+
45
+
</details>
46
+
47
+
48
+
49
+
50
+
Composer
51
+
Installation with the composer is very simple, this package is only for NFS KOT so we need to fetch the package from a private repository. For that, you just need to add the below lines in your root composer.json file.
52
+
53
+
Open `composer.json` and add the below line under the repositories array. If you have any other package then append this package. The must look like below.
After adding the above code try to install the package in your project.
68
+
35
69
36
-
After the composer add the service provider in your `config/app.php`. Open file `config/app.php` and add the below line under the provider's array, better to add it in the packages section.
70
+
````
71
+
composer require lcw/activitylog
72
+
````
37
73
74
+
## Add Service
75
+
After the composer add the service provider in your `config/app.php`. Open file config/app.php and add the below line under the provider's array, better to add it in the packages section.
38
76
````
39
77
/*
40
78
* Package Service Providers...
@@ -44,53 +82,91 @@ After the composer add the service provider in your `config/app.php`. Open file
After migration `publishes` just run a simple command to add a table.
96
+
## Config Export
97
+
You can also export the config file into your project root config, this function empowers you to change things if you want. With the config export, you can set the delete limit in your config file and also you can add route PATH/NAMES where you don't want to save activity.
54
98
99
+
To export the config on your root run the below command.
Set config in settings ignore_route [If set system ignore to create the activity on that route]
58
120
59
-
There is a default view to see the logs but you can made your own log view in your app. With this package one route will be created which is mentioned below.
121
+
You can also delete the data and change the default limit by editing the config file config\lcw_activity_log_config.php. Pass the value in months default is set at 3 Months.
60
122
123
+
# Define in months only
124
+
````
125
+
delete_limit = 2
61
126
````
127
+
Default View
128
+
There is a default view to see the logs but you can make your own log view in your app. With this package, one route will be created which is mentioned below.
129
+
130
+
131
+
62
132
# Route Name
133
+
````
63
134
lcw_activity_log_index
64
-
135
+
````
65
136
# URI
137
+
````
66
138
Your-Domain-Url/log
67
139
````
68
-
69
140
You can create your own view and get the log data by using the below method in your controller.
70
141
71
142
````
72
143
use Lcw\Activitylog\ActivityLog;
73
-
74
144
$activityLog = new ActivityLog();
75
145
$log = $activityLog->get($request);
76
146
````
77
-
78
-
You can also delete the data and change the default limit by defining the variable in your environment.
79
-
Pass the value in months default is set at `3 Months`. Open the `.env` file and define the below variable to change the default auto-delete process.
80
-
147
+
You also can delete the log by calling the logDelete() method like below in your controller.
81
148
````
82
-
# Define in months only
83
-
84
-
ACTIVITY_LOG_DEL=1
149
+
use Lcw\Activitylog\ActivityLog;
150
+
$activityLog = new ActivityLog();
151
+
$log = $activityLog->logDelete(1); # delete all one month old log data
85
152
````
86
153
87
-
And you also can delete the log by calling the `logDelete` method like below in your controller.
154
+
## Custom Creation
155
+
You can create a custom activity log with the below method. The parameters you need to pass in the custom log are given below.
156
+
````
157
+
@param log [string]
158
+
@param server_ip [The server IP address]
159
+
@param user_ip [The client/user IP address]
160
+
@param route_detail [Array with route path details]
161
+
@param query_string [Array with parameters]
162
+
@param user_id [Auth session id]
163
+
@param user [Array of auth]
164
+
@param created_at [datetime]
165
+
````
88
166
89
167
````
90
168
use Lcw\Activitylog\ActivityLog;
91
-
92
169
$activityLog = new ActivityLog();
93
-
$log = $activityLog->logDelete(1); # delete all one month old log data
0 commit comments