laravel-log-viewer
laravel-log-viewer copied to clipboard
Laravel 11 Support
Please make support for Laravel 11, right now its not compatible.
++
bump
I have made my own temporary solution, not ideal but works, remember to make it protected by a middleware
public function showLaravelLogs()
{
$deleteAllFiles = \Request::get('delete-all-files') == "true";
$path = storage_path('logs');
$files = \File::allFiles($path);
if (!$deleteAllFiles) {
echo "<a href='?delete-all-files=true'>Remove all filez<a/>";
}
foreach ($files as $file) {
$actualPath = $path . DIRECTORY_SEPARATOR . $file->getFilename();
if ($deleteAllFiles) {
unlink($actualPath);
continue;
}
$path2Display = file_get_contents($actualPath);
echo "<h1 style='display: block'>{$file->getFilename()}</h1>";
echo "<div><pre>$path2Display</pre></div>";
}
if ($deleteAllFiles) {
return redirect('/backoffice/logs');
}
}
Thank you for your contribution! I just released an updated version that accepts Laravel 11 (v2.4.0). Let me know if there is any problem