PHP code example of kha333n / laravel-logger
1. Go to this page and download the library: Download kha333n/laravel-logger library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kha333n / laravel-logger example snippets
'providers' => [
jeremykenedy\LaravelLogger\LaravelLoggerServiceProvider::class,
];
php artisan migrate
$app->register(\Jaybizzle\LaravelCrawlerDetect\LaravelCrawlerDetectServiceProvider::class);
$app->configure('laravel-logger');
$app->register(\jeremykenedy\LaravelLogger\LaravelLoggerServiceProvider::class);
$app->routeMiddleware(['activity' => \jeremykenedy\LaravelLogger\App\Http\Middleware\LogActivity::class, ]);
php artisan migrate
activity
Route::group(['middleware' => ['web', 'activity']], function () {
Route::get('/', 'WelcomeController@welcome')->name('welcome');
});
use jeremykenedy\LaravelLogger\App\Http\Traits\ActivityLogger;
use ActivityLogger;
'disableRoutes' => env('LARAVEL_LOGGER_DISABLE_ROUTES', false),
Route::group(['prefix' => 'activity', 'namespace' => 'jeremykenedy\LaravelLogger\App\Http\Controllers', 'middleware' => ['web', 'auth', 'activity']], function () {
// Dashboards
Route::get('/', 'LaravelLoggerController@showAccessLog')->name('activity');
Route::get('/cleared', ['uses' => 'LaravelLoggerController@showClearedActivityLog'])->name('cleared');
// Drill Downs
Route::get('/log/{id}', 'LaravelLoggerController@showAccessLogEntry');
Route::get('/cleared/log/{id}', 'LaravelLoggerController@showClearedAccessLogEntry');
// Forms
Route::delete('/clear-activity', ['uses' => 'LaravelLoggerController@clearActivityLog'])->name('clear-activity');
Route::delete('/destroy-activity', ['uses' => 'LaravelLoggerController@destroyActivityLog'])->name('destroy-activity');
Route::post('/restore-log', ['uses' => 'LaravelLoggerController@restoreClearedActivityLog'])->name('restore-activity');
});
bash
php artisan vendor:publish --tag=LaravelLogger