Download the PHP package arpanihan/auditify without Composer

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

Auditify β€” High-Performance, Decoupled Audit Logging for Laravel

Latest Version on Packagist Total Downloads

Auditify is an easy-to-use, high-performance audit logging and threat detection package for Laravel.

πŸ”— Official Landing Page & Demo: arpa12.github.io/laravel-auditify-landingPage

Unlike standard logging libraries, Auditify uses a decoupled database design to separate logs into three distinct tables. This optimizes database table indexing, reduces write congestion, and guarantees clean scale organization as your application grows.


Table of Contents


πŸ–₯️ Requirements

Laravel PHP
13.x 8.3 – 8.4
11.x, 12.x 8.2 – 8.4
10.x 8.2 – 8.3

πŸš€ Features

πŸ“Š Dashboard

URL: /auditify

The main glassmorphic dashboard aggregates action logs, page visits, and threat alerts into an interactive screen:

πŸ“ˆ Reports & Analytics Module

URL: /auditify/reports

A comprehensive reporting panel offering detailed statistical breakdowns over custom timeframes (Last 7 Days, Last 30 Days, or Last 90 Days) featuring interactive Chart.js charts:

πŸ—„οΈ Decoupled Log Modules

Auditify separates data logging into three target models under Auditify\Models to avoid write bottlenecks. Here is the exact database schema and attributes captured for each log type:

Action Logs (ActionLog)

Activity Logs (ActivityLog)

Security Logs (SecurityLog)

πŸ“ˆ Real-Time Threat Engine

Auditify automatically monitors activity logs and logs high-priority Security entries when rules are broken:

πŸ›‘οΈ XSS Attack Shield

Auditify has built-in XSS protection. It automatically scans all incoming request parameters (such as $_GET or $_POST) and route variables.

If it detects common XSS patterns (like <script>, javascript:, or SVG events), it:

  1. Logs a critical security log entry.
  2. Returns an HTTP 403 Forbidden response to block the request.

If you have pages that require rich text input (e.g. admin markdown or HTML editors), exclude them in your config/auditify.php file:

πŸ”Œ Frontend Event Logging API (Optional)

[!NOTE] What is this for? Standard backend code (like Laravel/PHP) cannot see what happens inside the user's browser. Out-of-the-box, it cannot track when a user clicks a button, closes a modal, or downloads a file.

This API provides a built-in route (/auditify/api/events) so you can easily send browser actions straight into your Activity Logs via JavaScriptβ€”without needing to write your own custom API controllers and routes. You can ignore this if you don't need to track frontend actions.

How to use it:

  1. Create a reusable JavaScript helper to send a POST request (which automatically attaches Laravel's CSRF security token):

  2. Trigger it on user actions (like clicking a button or a download link):

βš›οΈ Vue & React Integration (SPAs)

If your application uses a frontend framework like React or Vue.js:

βš›οΈ React Component Example (using Axios)
πŸ’š Vue 3 Component Example (using Fetch API)

πŸ” Admin-Only Access & Custom Authorization Gate

[!IMPORTANT] Who should access the logs? The Auditify log database and visual dashboard (/auditify) contain highly sensitive information including user IP addresses, request payloads, model modifications, and security alert histories.

Regular application users must never have access to this package. It is designed exclusively for system administrators, super-admins, and security officers.

By default, the package enables access control if configured in config/auditify.php. You should register an authorization callback inside your application so developers can custom-define exactly who is classified as an authorized admin.

To restrict dashboard views and log downloads to administrators only, register an authorization callback inside the boot method of your app/Providers/AppServiceProvider.php:


πŸ“¦ Installation

1. Install via Composer

Run this command in your project root:

2. Run the Installer

Run the installation command to publish configuration files, copy migrations, and set up your database automatically (this command will also automatically clear your application cache using optimize:clear):

3. Clear Application Cache (Optional)

If needed, you can manually clear all cached configuration, routes, views, and other cached data to ensure Auditify loads the latest settings:

4. Start the Laravel Development Server

If your application is not already running, start the Laravel development server:

5. Access the Dashboard

Once the installer completes successfully, open your web browser and navigate to the Auditify dashboard URL:

(Note: If you change the 'route_prefix' config setting inside config/auditify.php, this route URL will update accordingly).

4. (Optional) Selective Model Auditing

By default, Auditify automatically audits all Eloquent models globally without any manual setup.

However, if you turn off global auditing ('auto_audit_models' => false) and prefer to manually select which models to audit, add the Auditable trait:


βš™οΈ Configuration

After publishing, customize your settings in config/auditify.php:


πŸ”Œ Manual Logging & Helper Methods

You can manually trigger Auditify logs or temporarily pause auditing from your own Laravel controllers, background jobs, or seeders using the Auditify facade.

[!TIP] Why use manual logging?

  • Capture Intent over CRUD: Automated auditing only tracks database changes (inserts/updates). It cannot know when a user performs a non-CRUD action like downloading a PDF report, requesting a password reset, or opening a modal.
  • Standardize Multi-step Workflows: Instead of cluttering logs with 10 automated database change entries during a checkout flow, you can pause automatic logging and write a single, clean entry (e.g., User Completed Purchase).
  • Log Custom Threat Metrics: Manually document custom suspicious behaviors (like rate-limit hits, coupon code abuse, or restricted API probes) using Auditify::logSecurity.
  • Optimize Seeding & Imports: Turn off auditing during massive database seeding or CSV user imports to prevent database write congestion, performance lags, and log spam.

1. Manual Log Generation

Import the facade in your file:

Manually Log a Database/Module Action

Manually Log a User Activity

Manually Log a Security Alert

Real-World Controller Example

Here is a practical example of how to implement manual logging inside a standard Laravel controller, complete with code comments:


2. Pausing Auditing (Seeders & Batch Imports)

When running data migrations, database seeders, or large CSV imports, you should temporarily disable logging:

Option A: Running a closure (Recommended for Seeders & Migrations)

Where to use: In database/seeders/DatabaseSeeder.php or data migration files.

This helper automatically pauses auditing for the duration of the callback execution and safely restores the previous auditing state.

[!TIP] Why Option A is recommended (Exception Safe): If an error occurs inside your import/seeder logic, this helper uses an underlying PHP finally block to guarantee that auditing is safely re-enabled for all subsequent requests.

Option B: Manually toggle auditing (Recommended for Artisan Commands & Test Suites)

Where to use: In custom Artisan console commands (app/Console/Commands/ImportData.php) or PHPUnit test setups (tests/TestCase.php).

Directly turns the auditing flag on or off.

[!WARNING] Use Option B with caution: If your code throws an exception after calling disableAuditing(), it will crash before reaching enableAuditing(), leaving auditing permanently disabled on that PHP worker/process. Only use this option when a closure structure cannot be used.


πŸ› οΈ Artisan Commands

Auditify provides dedicated commands to automate installation and database size optimization:

Command Description
auditify:install Runs migrations and publishes configuration files automatically.
auditify:prune {--days=} Deletes old audit log records older than N days (defaults to keep_days config value).

1. Why use the commands?

2. Automated Database Pruning Setup

To keep database tables small and performant automatically, schedule the pruning command in your application's task scheduler in routes/console.php (or app/Console/Kernel.php):

[!TIP] Set It and Forget It: Automating the pruning command to run daily ensures your database size remains constrained and healthy without manual administrator intervention. It is recommended to schedule it during low-traffic night hours.


πŸ—ΊοΈ Routes Reference

All routes are grouped under the configured route_prefix (default: auditify) with the configured middleware.

Method URI Controller Action Description
GET / DashboardController@index Main logs dashboard index
GET /action-logs ActionLogController@index View list of database action logs
GET /action-logs/{id} ActionLogController@show View details with side-by-side attributes difference
GET /action-logs/export/csv ActionLogController@exportCsv Export action logs in CSV format
GET /action-logs/export/excel ActionLogController@exportExcel Export action logs in Excel format
GET /action-logs/export/pdf ActionLogController@exportPdf Export action logs in PDF format
GET /activity-logs ActivityLogController@index View list of activity logs
GET /activity-logs/{id} ActivityLogController@show View activity log details
GET /activity-logs/export/csv ActivityLogController@exportCsv Export activity logs in CSV format
GET /activity-logs/export/excel ActivityLogController@exportExcel Export activity logs in Excel format
GET /activity-logs/export/pdf ActivityLogController@exportPdf Export activity logs in PDF format
GET /security-logs SecurityLogController@index View list of security logs
GET /security-logs/unread-check SecurityLogController@checkUnreadAlerts Live alert poll check
GET /security-logs/{id} SecurityLogController@show View security log details
POST /security-logs/{id}/read SecurityLogController@markAsRead Toggle log read state
GET /security-logs/export/csv SecurityLogController@exportCsv Export security logs in CSV format
GET /security-logs/export/excel SecurityLogController@exportExcel Export security logs in Excel format
GET /security-logs/export/pdf SecurityLogController@exportPdf Export security logs in PDF format
POST /api/events ActivityLogController@storeFrontendEvent Frontend client-side interaction logging
GET /reports ReportController@index View detailed log analytics and reports

πŸ§ͺ Testing

The package features a comprehensive PHPUnit test suite covering models, middlewares, controller endpoints, and Artisan commands. Standalone tests run via orchestra/testbench without requiring a parent Laravel installation.

Clone the repository and install development dependencies:

Run all tests:


πŸ‘€ Author

Arpa Nihan
Full Stack Developer

LinkedIn GitHub


πŸ“„ License

Released under the MIT License.

⭐ If Auditify saves you time, please give it a star on GitHub! ⭐

Made with ❀️ for the Laravel Community

Copyright © 2026 Arpa Nihan. All rights reserved.


All versions of auditify with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.3
maatwebsite/excel Version ^3.1
barryvdh/laravel-dompdf Version ^2.1|^3.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 arpanihan/auditify contains the following files

Loading the files please wait ...