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.
Download arpanihan/auditify
More information about arpanihan/auditify
Files in arpanihan/auditify
Package auditify
Short Description A powerful, intuitive, and efficient action and activity log tracking package for Laravel applications.
License MIT
Homepage https://github.com/arpanihan/auditify
Informations about the package auditify
Auditify - Laravel Action and Activity Log Package
Auditify is a flexible and easy-to-use package for Laravel that allows you to log Action Logs (system-level actions like CRUD operations) and Activity Logs (frontend user interactions like page visits, button clicks, etc.). The package is highly configurable and can be easily integrated into any Laravel project.
β¨ Key Features
- οΏ½ Action Logging: Track system-level operations (CRUD actions, logins, etc.)
- π Activity Logging: Monitor user interactions (page visits, button clicks, tab switches)
- π― Frontend JavaScript Integration: Automatic frontend activity tracking
- βοΈ Fully Configurable: Customize table names, log types, pagination via config
- π‘οΈ Safe Installation: No foreign key constraints, configurable table names
- π API Ready: JSON endpoints for custom frontends
- π Laravel 9+ Compatible: Works with modern Laravel versions
οΏ½ Requirements
- PHP >= 8.0
- Laravel >= 9.0
- Composer
π Installation
π’ Recommended: Safe Installation (All Projects)
This command will:
- β Check for table conflicts before creating anything
- β Publish config with safe defaults
- β Run only Auditify migrations (not your existing ones)
- β Publish assets safely
- β Provide clear feedback on each step
π Check Installation Status
π‘ Alternative: Manual Installation (Advanced Users)
If you prefer manual control or need specific migration paths:
π Get Specific Migration Paths
π΄ β AVOID: Full Migration Command
β οΈ DO NOT USE in existing projects:
Instead use:
βοΈ Configuration
The package comes with a comprehensive configuration file. After publishing, you can modify config/auditify.php:
Environment Variables
You can also use environment variables in your .env file:
Running Migrations
After publishing the migration files, you can run the migrations for Auditify separately from your existing migrations to avoid conflicts with your projectβs database.
To run only the Auditify migrations, use the following command:
This will apply only the Auditify migrations and will not interfere with any other migrations in your project. Ensure that your_auditify_migration_folder points to the correct folder where Auditify migrations are located.
If you want to run all migrations, including your project migrations, simply use:
However, we recommend running the package-specific migrations to avoid any issues.
Configuration
After publishing the config file, you can modify the config/auditify.php file to suit your needs.
Example Configuration (config/auditify.php):
Dynamic Configuration
- Activity Log Events: You can enable or disable specific events like page visits, tab switches, modal openings, and button clicks.
- Action Log Modules: Specify the modules you want to track, such as
user,product,order,report. Add or remove modules as needed. - Table Names: You can customize the table names for both activity logs and action logs.
- Pagination: Adjust the number of logs per page using the
paginationsection. - Log Retention: Optionally delete older logs after a specified number of days (e.g., after 365 days).
π Usage
Action Logging
Log system-level operations like CRUD actions, logins, etc:
Activity Logging
Log user interactions and frontend activities:
Frontend JavaScript Integration
Automatically track frontend activities with the included JavaScript module:
Using Facades
You can also use the package facades for cleaner code:
π API Endpoints
The package provides API endpoints for external integrations:
π οΈ Troubleshooting
Common Issues & Solutions
β "Table already exists" Error
Problem: Migration fails because table names conflict with existing tables.
Solution:
β "Migration ran all my migrations"
Problem: Used php artisan migrate instead of safe installation.
Solution:
β "Config not found" Error
Problem: Configuration file not published.
Solution:
β JavaScript not working
Problem: Assets not published.
Solution:
Quick Commands Reference
π§ͺ Testing
The package is thoroughly tested. Run tests in your Laravel project:
Example Test
ActivityLogger::log('tab_switch', 'Switched to settings tab', null, 'Settings'); ActivityLogger::log('modal_open', 'Opened user profile modal', null, 'Users');
Logging an Activity
To log user activities (e.g., page visits, button clicks, etc.), use the ActivityLogger service.
Frontend Activity Logging (JavaScript)
The Auditify package includes a JavaScript file (activityLog.js) for logging frontend activities. You can include it in your Blade views.
Example Usage:
Customizing the JavaScript Path
If you prefer to use a custom path for the activityLog.js file, simply modify the activity_js_path key in config/auditify.php.
π§ Advanced Configuration
Custom Table Names
Avoid conflicts by customizing table names in your .env file:
Disabling Routes
If you want to use only the logging functionality without web routes:
Role Resolution
The package safely resolves user roles. If you have a custom Role model:
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
π License
This package is open-sourced software licensed under the MIT license.
π¨βπ» Author
ArpaNihan
- Email: [email protected]
- GitHub: @arpanihan
π Package Stats
- Minimum PHP: 8.0+
- Laravel Compatibility: 9.0+
- Dependencies: Minimal (only illuminate/support)
- Database: MySQL, PostgreSQL, SQLite compatible
- File Size: Lightweight package
Ready to track every action in your Laravel app? Install Auditify today! π
All versions of auditify with dependencies
illuminate/support Version >=9.0
illuminate/database Version >=9.0
illuminate/http Version >=9.0