This package will help to keep log in database with type for Laravel applications.
Via Composer
$ composer require abhishekkrhaith11/dblog
After installation you need to add the following line to config/app.php -
'providers' => [
/*
* Package Service Providers...
*/
Abhishekkrhaith11\Dblog\DblogServiceProvider::class,
]
If you want to use alias add the following -
'aliases' => [
/*
* Package Facades...
*/
'Dblog' => Abhishekkrhaith11\Dblog\Facades\Dblog::class,
]
After setup you need migrate the database using
$ php artisan migrate
You can change the database table name before migration. For that you have to publish configs. use -
$ php artisan vendor:publish --provider=Abhishekkrhaith11\Dblog\DblogServiceProvider
Available log methods -
Dblog::emergency(string $msg);
Dblog::alert(string $msg);
Dblog::critical(string $msg);
Dblog::error(string $msg);
Dblog::warning(string $msg);
Dblog::notice(string $msg);
Dblog::info(string $msg);
Dblog::debug(string $msg);
To retrive logs use -
Dblog::logs(string $type);
This will return a array of all logs found in log table. Each log will contain log type, message and log time.
If you found any issues you can report in github issues.
MIT. Please see the license file for more information.