Download the PHP package campelo/laravel-audit-log without Composer

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

Laravel Audit Log

Automatic audit logging for Laravel applications. Track who did what, when, where, and what changed.

Features

Installation

Publish the config and migrations:

Quick Start

1. Automatic Request Logging

The middleware is automatically registered. All POST, PUT, PATCH, DELETE requests will be logged.

2. Model Event Logging

Add the Auditable trait to your models:

3. Manual Logging

4. Error Logging

Automatically log all exceptions and errors that occur in your application.

Step 1: Configure in your .env:

Step 2: Integrate with your Exception Handler:

Manual error logging:

API Endpoints

The package provides built-in API endpoints to query audit logs:

List Audit Logs

Query Parameters:

Parameter Description Example
user_id Filter by user ID ?user_id=1
event Filter by event type ?event=updated or ?event=error
events Multiple events (comma-separated) ?events=created,updated
table Filter by table name ?table=users
model Filter by model class ?model=App\Models\User
model_id Filter by model ID (requires model) ?model=App\Models\User&model_id=1
method Filter by HTTP method ?method=POST
ip Filter by IP address ?ip=192.168.1.1
route Filter by route name ?route=users.update
response_code Filter by HTTP response code ?response_code=500
date_from Filter from date ?date_from=2024-01-01
date_to Filter to date ?date_to=2024-12-31
search Search in description, URL, user name/email ?search=john
per_page Items per page (max 100) ?per_page=50
sort Sort field ?sort=performed_at

Examples:

| order | Sort order (asc/desc) | ?order=desc |

Get Single Entry

Get Logs for Model

Get Logs for User

Get Statistics

Returns:

Get Filter Options

Returns available values for events, tables, methods, and users.

Cleanup Old Logs

Automatic Cleanup

The package includes a command to clean up old audit logs based on retention policy.

Configuration

Automatic Cleanup (Recommended)

Enable automatic cleanup in your .env:

The package will automatically register the cleanup command in Laravel's scheduler. Make sure your server has cron configured:

Manual Cleanup

Run the cleanup command manually:

Manual Scheduler Registration

If you prefer to register the command manually in your app/Console/Kernel.php:

Notifications

Get notified via Email and/or Slack when critical errors (5xx) occur.

Configuration

Requirements

Throttling

To prevent notification spam, the package throttles repeated errors:

Which errors trigger notifications

By default, only server errors (5xx) trigger notifications. You can customize via .env:

Or in config file:

Performance Logging

Track slow database queries and slow HTTP requests for performance monitoring.

Configuration

Querying Performance Logs

API Endpoints

Response Format

Slow Query:

Slow Request:

Rollback

Revert model changes based on audit log history. Only authorized users can perform rollback.

Configuration

Basic Rollback

Rollback from Model

Rollback Chain (Multiple Undos)

API Endpoints

Rollback Events

Each rollback creates a new audit log with event rollback:

Querying Rollbacks

Limitations

Query Using Model

Query Examples

Normal Operation Logs (CRUD)

Error Logs

Combined Queries

Accessing Audit Logs from Models

Configuration

Customization

Custom User Resolver

Custom Audit Data

Response Format

Normal Operation Log

Error Log

License

MIT


All versions of laravel-audit-log with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0
illuminate/database Version ^10.0|^11.0
illuminate/http Version ^10.0|^11.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 campelo/laravel-audit-log contains the following files

Loading the files please wait ...