Easily stream your Laravel application logs to the browser console tab (console.log) in real-time using server-sent event (SSE)
Welcome to Laravel Console Log (LCL)! This package brings real-time logging to your Laravel application, allowing you to stream your logs directly to your browser's console. Perfect for backend developers who want the power of console.log for their PHP projects. Say goodbye to tedious log file hunting and hello to instant insights!
Not recommended for production.
composer require --dev saasscaleup/laravel-console-log
Add the Service Provider to config/app.php in the providers section:
Saasscaleup\LCL\LCLServiceProvider::class,
Add the Facade to config/app.php in the aliases section:
'LCL' => Saasscaleup\LCL\Facades\LCLFacade::class,
Publish Config, Migration, and View Files
php artisan vendor:publish --provider="Saasscaleup\LCL\LCLServiceProvider"
Create the stream_console_logs table:
php artisan migrate
Add this to your main view/layout (usually layout/app.blade.php) file before
The above is the detailed content of PHP Version of console.log() for Laravel. For more information, please follow other related articles on the PHP Chinese website!