https://github.com/dnj/laravel-user-logger
Log User Activities in Laravel App
https://github.com/dnj/laravel-user-logger
Last synced: 5 months ago
JSON representation
Log User Activities in Laravel App
- Host: GitHub
- URL: https://github.com/dnj/laravel-user-logger
- Owner: dnj
- License: mit
- Created: 2023-01-03T10:30:46.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-02-24T10:38:58.000Z (over 2 years ago)
- Last Synced: 2025-10-06T12:54:18.503Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 126 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Log activity inside your Laravel app
The `dnj/laravel-user-logger` package provides easy way to log the activities of the users of your app.
The Package stores all activity in the `logs` table.
Here's a demo of how you can use it:
```php
$logger = app(dnj\UserLogger\Contracts\ILogger::class);
$log = $logger
->performedOn($anEloquentModel)
->causedBy($user)
->withProperties(['customProperty' => 'customValue'])
->log('edit');
```
## Installation
You can install the package via composer:
```bash
composer require dnj/laravel-user-logger
```
The package will automatically register itself.
After this you can create the `logs` table by running the migrations:
```bash
php artisan migrate
```
You can optionally publish the config file with:
```bash
php artisan vendor:publish --provider="dnj\UserLogger\ServiceProvider" --tag="config"
```
## Security
If you've found a bug regarding security please mail [security@dnj.co.ir](mailto:security@dnj.co.ir) instead of using the issue tracker.
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.