sudippalash / activity-log
Laravel package for Activity log
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Blade
Requires
- php: ^7.3|^8.3
- laravel/framework: ^8.0|^9.0|^10.0|^11.0
- spatie/laravel-activitylog: ^4.0
README
activity-log
is a activity log management package of Laravel
that provides options to create & manage activity log.
Note: This package is wrapper of spatie/laravel-activitylog
package.
Install
Via Composer
composer require sudippalash/activity-log
Publish config & migrations files
You should publish
migrations files:
database/migrations/create_activity_log_table.php
database/migrations/add_event_column_to_activity_log_table.php
,database/migrations/add_batch_uuid_column_to_activity_log_table.php
,
config files:
config/activitylog.php
,config/activity-log.php
with:
php artisan vendor:publish --provider="Sudip\ActivityLog\Providers\AppServiceProvider" --tag=required
For config/activitylog.php
file you should check spatie/laravel-activitylog
package documentation.
This is the contents of the published config file config/activity-log.php
:
return [ /* |-------------------------------------------------------------------------- | Extends Layout Name |-------------------------------------------------------------------------- | | Your main layout file path name. Example: layouts.app | */ 'layout_name' => 'layouts.app', /* |-------------------------------------------------------------------------- | Section Name |-------------------------------------------------------------------------- | | Your section name which in yield in main layout file. Example: content | */ 'section_name' => 'content', /* |-------------------------------------------------------------------------- | Route Name, Prefix & Middleware |-------------------------------------------------------------------------- | | Provide a route name for activity-log route. Example: user.activity-logs | Provide a prefix name for activity-log url. Example: user/activity-logs | If activity-log route use any middleware then provide it or leave empty array. Example: ['auth'] */ 'route_name' => 'user.activity-logs', 'route_prefix' => 'user/activity-logs', 'middleware' => [], /* |-------------------------------------------------------------------------- | Bootstrap version |-------------------------------------------------------------------------- | | Which bootstrap you use in your application. Example: 3 or 4 or 5 | */ 'bootstrap_v' => 5, /* |-------------------------------------------------------------------------- | CSS |-------------------------------------------------------------------------- | | Add your css class in this property if you want to change design. */ 'css' => [ 'container' => null, 'card' => null, 'input' => null, 'btn' => null, 'table' => null, 'table_action_col_width' => null, 'table_action_btn' => null, ], ];
Optionally, you can publish the views using
php artisan vendor:publish --provider="Sudip\ActivityLog\Providers\AppServiceProvider" --tag=views
Optionally, you can publish the lang using
php artisan vendor:publish --provider="Sudip\ActivityLog\Providers\AppServiceProvider" --tag=lang
You should run the migrations with:
php artisan migrate
Usage
You should copy the below line and paste in your project menu section
<a href="{{ route(config('activity-log.route_name') . '.index') }}">{{ trans('activity-log::sp_activity_log.activity_logs') }}</a>
Use this `ActivityLog`` trait in your model(s). It will automatically store all DB-related events to the model(s).
use Sudip\ActivityLog\Traits\ActivityLog; class User extends Authenticatable { use ActivityLog; ... }