Download the PHP package julesgraus/actionlogs without Composer
On this page you can find all versions of the php package julesgraus/actionlogs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download julesgraus/actionlogs
More information about julesgraus/actionlogs
Files in julesgraus/actionlogs
Informations about the package actionlogs
Actionlogs
Log any actions users do in your Laravel application.
Installation
You can install the package via composer:
Usage
Direct logging
You can log actions directly like so:
The logged action wil be linked to the authenticated user if any. The payload can be anything but a resource.
Automatic logging
The package listens to some events in the namespace by default and automatically logs those. This is a list of those events:
- Login
- Logout
- Failed
- Lockout
- Registered
- PasswordReset
- Verified
You can listen to extra events if you would like to. You could for example do that like so:
Put that line of code in the register method of a service provider in your implementation.
Housekeeper
The package is compatible with . Register the class to the housekeeper and read the published config options for more info.
Customisation
Configuration and localisation
publish the config files and translation file of this package by running . You can then edit the config file that will be put in the config dir. And the translations that are put in
Overriding the default Actionlog model
When the default model from this package does not provide the functionality you want, you can create a custom model yourself.
Just make sure it implements and then register it to Laravel's container in the register method of a service provider like so:
Also make sure your custom implementation can accept any variable type for the payload attribute except a resource type.
Overriding other stuff
Like the actionlog model you can also override other stuff by implementing and registering these interfaces in the namespace:
- ActionlogPolicy
- ActionlogResource
- ActionlogResourceCollection
Please bind resources and collections to a function that returns the class name of an implementation. Else Laravel will try to instantiate the classes and nag about the resource parameter that it cannot resolve.
Testing
Run tests by running this command in the root of the package.