Download the PHP package ndexondeck/lauditor without Composer
On this page you can find all versions of the php package ndexondeck/lauditor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ndexondeck/lauditor
More information about ndexondeck/lauditor
Files in ndexondeck/lauditor
Informations about the package lauditor
Lauditor
Lauditor is a laravel based auditing and authorization package, which helps you control your manage tasks, permissions and user groups. It is designed to manage all application tasks and user permission by utilization laravel's routes.
Table of Contents
- How
- Publish Vendor Files
- Auditing
- Authorization
- User Models
- Generating Tasks
- Flushing Your Database
- Request and Response for APPLICATION API
How?
Install with Composer:
Publish Vendor Files
Lauditor comes with predefined controllers and models to fast-track your development, but you may already have something in place that you are never going to replace. Then you may not want to publish all the files, so running the vendor:publish with minimal would be a better option, this ensures you only publish the necessary files.
To publish all files
Some others would prefer:
Note: If you would'nt be using the default controllers or models provided by this package. For instance, Login model will be published because it is the default Audit user model. Please take a look at User Models before running your migrations
After this please uncomment the name spaces in the following files
app/Ndexondeck/Lauditor/Util.php
TO
Similar, do the same for the following 1) app/BaseModel.php (required) 1) app/Module.php (required) 1) app/Task.php (required) 1) app/Permission.php (required) 1) app/PermissionAuthorizer.php (required) 1) app/Group.php 1) app/Login.php 1) app/Staff.php
=> Note that all these models will be copied from the library, to you app folder, you can do away with or modify then where necessary
=> Furthermore, there are certain methods in the Util class that needs to be updated, please see App\Ndexondeck\Lauditor\Util form more
Auditing
Authorization
User Models
This is the default user model configuration for auditing and authorization, you can change it if your user models are different
Any model that will be used for audit user must implement the AuditUser interface
So if your config for audit user is like
Then the User model must implement AuditUser as shown below
Similarly, models that will be used for authorization user must implement the AuthorizationUser interface
Also, if the same User model is to be used as authorization_user as shown in the config below
Then the User model must also implement AuthorizationUser as shown below
Generating Tasks
This feature works with your routes, where unique route naming is ensured
php artisan task:generate
Flushing Your Database
This feature can help you flush your database, even multiple database simultaneously. See help for more
php artisan db:flush
Request and Response for APPLICATION API
If you would like to document additional information like the request and response of all your API's, you can add "\Ndexondeck\Lauditor\Middleware\LogAfterRequest::class" the Http/Kernel.php file as shown below.
Audits (How it Works)
- The audit trail approach is a background process, which occurs at a Model level, any change to a model can be detected and then audited if the model is a child of Audit model.
Consider this: We want to keep audit trails of Staff Model below.
The Audit model binds the creating, updating and deleting event listeners to the Staff model, through which audit trails can be captured.
- Now lets get to see the available methods
...still loading
...meanwhile thanks to Adekunle Adekoya (Crystoline) for Helping out with testing
All versions of lauditor with dependencies
illuminate/support Version ^5.5
themsaid/laravel-model-transformers Version ^1.0