mdhossain/laravel-logs is a Laravel package for audit logs and error logs for laravel.
It currently has 1 GitHub stars and 10 downloads on Packagist.
Install it with composer require mdhossain/laravel-logs.
Discover more Laravel packages by mdhossain
or browse all Laravel packages to compare alternatives.
Last updated
Its easy to use in your laravel app. You can save all audit and error log type data and then also show all in your laravel app. Easy to track your actions and also find errors from your application by using this package. All logs are stored in database in this package.
composer create-project --prefer-dist laravel/laravel packagetestapp
cd packagetestapp
cp .env.example .env
php artisan key:generate
composer require mdhossain/laravel-logs
config/app.php inside the providers array:'providers' => [
...,
App\Providers\RouteServiceProvider::class,
// Our new package class
Mdhossain\LaravelLogs\LaravelLogsServiceProvider::class,
],
php artisan migrate:refresh
use MDHossain\laravelLogs\Contracts\ActivityLogInterface;
public function insertUser(ActivityLogInterface $activitylog){
$activitylog->dataSave($id=null, $log_description, $data, $log_title, $log_type);
}
use MDHossain\laravelLogs\Contracts\ActivityLogInterface;
public function showLogs(ActivityLogInterface $activitylog){
For audit logs
$activitylog->getAllAuditLogs();
For error logs
$activitylog->getAllErrorLogs();
}
use MDHossain\laravelLogs\Contracts\ActivityLogInterface;
public function filterLogs(ActivityLogInterface $activitylog){
For audit logs Search by to date and from date
$activitylog->allAuditLogs($search = array();
For error logs Search by to date and from date
$activitylog->allErrorLogs($search = array();
}
http://localhost:8000/audit-log
http://localhost:8000/error-log
OR
return view('laravel-logs::auditlogs.audit-log');
return view('laravel-logs::errorlogs.error-log');
And finally, start the application by running:
php artisan serve
Visit http://localhost:8000/ in your browser to view the demo.