webqamdev / activity-logger
Log every model creation, edition and deletion.
Installs: 32 676
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 0
Open Issues: 1
Requires
- php: ^8.3
- spatie/laravel-activitylog: ^4.5
Requires (Dev)
- laravel/pint: ^1.24
- dev-master
- 3.0.1
- 3.0.0
- 2.1.1
- 2.1.0
- 2.0.0
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-fix/php84
- dev-fix/purge-db-log
- dev-feat/keep-old-data
- dev-feat/use-spatie-format
- dev-1-utiliser-l-attribute-logattributestoignore-de-spatie-laravel-activitylog
- dev-feat/laravel-9
- dev-features/task-delete-logs
- dev-disable-db
This package is auto-updated.
Last update: 2025-08-26 08:12:28 UTC
README
The webqamdev/activity-logger
package automatically log model changes from users into database and log files.
Dependencies
This package use spatie/laravel-activitylog to store logs in database. Feel free to configure it if needed or just follow Installation instructions.
Installation
You can install the package via composer:
composer require webqamdev/activity-logger
The package will automatically register itself.
Configure spatie/laravel-activitylog. By default, run those commands :
php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider" --tag="activitylog-migrations" php artisan migrate
You can optionally publish the config file with:
php artisan vendor:publish --provider="Webqamdev\ActivityLogger\ActivityLoggerServiceProvider" --tag="config"
Usage
Globally hide a property
Publish config file. Then add entries to properties_hidden
array.
Hide a Model property
Create your model normally, then define hidden properties.
class User extends Model { /** * The attributes that shouldn't be logged in activity logger. * * @var array */ public $logAttributesToIgnore = [ 'password', 'phone', ]; ... }
Disable logs into database
Add ACTIVITY_LOGGER_TO_DATABASE=false
to your .env
file will prevent logger from writing into database.
Change files permission
If not already done, publish config file:
php artisan vendor:publish --provider="Webqamdev\ActivityLogger\ActivityLoggerServiceProvider" --tag="config"
Add channel.permission
to your config/activitylogger.php
file like this exemple:
'channel' => [ 'path' => storage_path('logs/activity.log'), 'level' => 'debug', 'days' => 14, 'permission' => 0644, // Default value, equivalent to bash's rw-r--r-- ],
Upgrading
Please see UPGRADING for details.
About
This package using Laravel 5.8 is a plugin for auto-logging activities.
Gitlab repository : Activity logger for Laravel Github repository : Activity logger for Laravel