Download the PHP package hexadog/laravel-auditable without Composer

On this page you can find all versions of the php package hexadog/laravel-auditable. 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-auditable

Package Logo

Latest Stable Version Total Downloads License

hexadog/laravel-auditable helps you to automatically register the user making action on your models.

Installation

This package requires PHP 7.3 and Laravel 7.0 or higher.

To get started, install Auditable using Composer:

The package will automatically register its service provider.

Usage

Use the new auditable macro into your migrations.

It will add the following columns:

Notice: You don't have to use timestamps() nor sofDeletes() macros. Auditable macro will integrate them for you.

If you altered you DB and want to drop auditable columns you can use the macro $table->dropAuditable();

Once database has been migrated you can use the Auditable trait into your model.

This way the id of the user responsible of the action (creation, update, soft deletion) is automatically registered into your model in the associated column each time the data is touched. You don't have to do anything.

Retreive user responsible of the action

You can retreive the user respoinsible of the last action (create, update, delete) by calling one of the helper methods provided by the trait.

To determine the user responsible of the model creation you may use the created_by attribute to get the id or the createdBy relation to get the target model:

To determine the user responsible of the last model update you may use the updated_by attribute to get the id or the updatedBy relation to get the target model:

To determine the user responsible of the model deletion (only if the model uses SoftDeletes trait) you may use the deleted_by attribute to get the id or the deletedBy relation to get the target model:

Credits

License

Laravel Auditable is open-sourced software licensed under the MIT license.


All versions of laravel-auditable with dependencies

PHP Build Version
Package Version
No informations.
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 hexadog/laravel-auditable contains the following files

Loading the files please wait ....