Download the PHP package insenseanalytics/laravel-user-audit-trails without Composer

On this page you can find all versions of the php package insenseanalytics/laravel-user-audit-trails. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-user-audit-trails

Laravel User Audit Trails

tests License Latest Stable Version Total Downloads

This package is created to add audit user trails by using Laravel Eloquent ORM. Using this package, you would be able to record in the respective database tables, the created_by, updated_by and deleted_by user IDs.

Basic Example

Add the audit trail columns in your database migrations like so:

Next, in your model just use the HasUserTrails and HasDeleteTrails trait to automatically setup audit user trails like so:

That's it! Now, sit back and observe the magic of audit user trails. When a new record is created, created_by will be updated to the user ID that created it. When a record is updated, updated_by will be updated to the user ID that updated it. When a record is soft deleted, deleted_by will be updated to the user ID that deleted it.

Requirements

Quick Installation

Service Provider (Optional / auto discovered on Laravel 5.5+)

Register provider on your config/app.php file.

Setting Up Custom Column Names

If you want to override the default audit trail names of created_by, updated_by and deleted_by, you may do so like so:

In your database migration, add the audit trail columns like so:

Next, in your model, override the static properties CREATED_BY, UPDATED_BY and DELETED_BY. Note that PHP does not allow overriding static properties in the same class, so you would need to extend your model class from a base model class that uses the \Insense\LaravelUserAuditTrails\HasUserTrails trait like so:

First create your base model class (if not already created). If already created, just add the trait.

Next, override the static properties CREATED_BY, UPDATED_BY and DELETED_BY in your model (that extends the base model) like so:

Omitting Updated By or Created By Columns

If you wish to omit one of the audit trail columns, you can just set the one you would like to omit to null in your database migration like so:

The example above omits the updated_by column. You can also do the reverse to omit updated_by by setting the first argument to null.

Next, override the static properties CREATED_BY and UPDATED_BY in your model (that extends the base model) to set the omitted property to null like so:

Contributing

We are open to PRs as long as they're backed by tests and a small description of the feature added / problem solved.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-user-audit-trails with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ^5.5|^6.0|^7.0|^8.0
illuminate/database Version ^5.5|^6.0|^7.0|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package insenseanalytics/laravel-user-audit-trails contains the following files

Loading the files please wait ....