Download the PHP package davidiwezulu/audittrail without Composer

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

Davidiwezulu/AuditTrail

Latest Version on Packagist Total Downloads Build Status License

Laravel Version

Overview

Davidiwezulu/AuditTrail is a Laravel package that automatically tracks changes to Eloquent models, providing:

This package is designed for applications that require comprehensive audit trails, ensuring data integrity and easy recovery of historical data.

Features

Installation

Requirements

Step 1: Install via Composer

Run the following command to install the package:

Step 2: Publish and Run Migrations

Publish the migration file for the audit_trails table:

Run the migrations:

Configuration

This package comes with default settings, but you can publish the configuration file if you'd like to customize the package further:

Usage

Step 1: Use the Auditable Trait in Your Model

To enable audit tracking for a model, use the Auditable trait in your Eloquent model:

Once the trait is included, the package will automatically log created, updated, and deleted events for this model.

Step 2: Accessing Audit Trails

You can retrieve the audit trail for a specific model using the auditTrails() relationship:

Step 3: Rollback to a Previous Version

To rollback a model to a previous version, you can use the rollbackTo() method:

The model will be restored to the old values recorded in the selected audit trail.

Events

By default, the package listens to the created, updated, and deleted events. You can modify which events are tracked by overriding the getAuditEvents method in your model:

Testing

This package comes with unit tests to ensure functionality. To run the tests, use the following command within the package itself:

Test Scenarios

1. Model Changes:

Verify that created, updated, and deleted events generate appropriate audit logs.

2. Rollback:

Ensure models can be reverted to previous versions using the rollback feature.

3. Relationships:

Confirm that the audit trail's morph relationships are correctly established between auditable models and users.


Contribution Guidelines

If you wish to contribute to this package, please follow these steps:

  1. Fork the repository.
  2. Create a feature branch:

  3. Commit your changes:

  4. Push to the branch:

  5. Open a pull request, and provide a description of your changes.

All contributions must adhere to the following guidelines:

License

This package is open-source software licensed under the MIT License.


All versions of audittrail with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^9.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 davidiwezulu/audittrail contains the following files

Loading the files please wait ....