coziboy/log-user-activity-for-backpack

Log user activity in backpack

1.0.4 2021-01-30 00:30 UTC

This package is auto-updated.

Last update: 2024-10-29 06:18:51 UTC


README

Latest Version on Packagist Total Downloads Build Status StyleCI

A simple interface for spatie/laravel-activitylog for Laravel Backpack.

Installation

  1. In your terminal
# install the package with composer
$ composer require coziboy/log-user-activity-for-backpack

# Publish view
$ php artisan vendor:publish --provider="Coziboy\LogUserActivityForBackpack\LogUserActivityForBackpackServiceProvider"

# [optional] Add a sidebar_content item for it
php artisan backpack:add-sidebar-content "<li class='nav-item'><a class='nav-link' href='{{ backpack_url('log-user') }}'><i class='nav-icon la la-history'></i> Log User Activity</a></li>"
  1. Finish all installation steps for spatie/laravel-activitylog, which has been pulled as a dependency. Run its migrations. Most likely it's:
php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider" --tag="migrations"
php artisan migrate
// To make this work all you need to do is let your model use the Spatie\Activitylog\Traits\LogsActivity-trait
  1. Change guard configuration values in config/backpack/base.php
'guard' => null,

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email tolong@buatin.website instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.