1. Go to this page and download the library: Download salioudiabate/log-viewer 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/ */
salioudiabate / log-viewer example snippets
use Salioudiabate\LogViewer\Livewire\LogTable;
Route::get('/logs', LogTable::class)
->middleware(['web', 'auth']) // and/or `can:...` — see Authorization below
->name('logs.index');
// config/log-viewer.php
'middleware' => ['web', 'auth'],
'download_url_ttl' => 60, // seconds a generated link stays valid
// routes/console.php or a scheduler service provider
$schedule->command('log-viewer:prune-backups')->daily();
// config/log-viewer.php
'color_scheme' => 'light', // null (follow the OS), 'light' or 'dark'
'modal_max_width' => '4xl', // entry-detail modal: a modal width token or any CSS length
use Livewire\Livewire;
use Salioudiabate\LogViewer\Livewire\LogTable;
Livewire::test(LogTable::class)
->assertSee('error')
->set('search', 'timeout')
->assertSee('Connection timeout');