Download the PHP package saasscaleup/laravel-stream-log without Composer
On this page you can find all versions of the php package saasscaleup/laravel-stream-log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download saasscaleup/laravel-stream-log
More information about saasscaleup/laravel-stream-log
Files in saasscaleup/laravel-stream-log
Package laravel-stream-log
Short Description Easily stream your Laravel application logs to the frontend in real-time using server-sent event (SSE)
License MIT
Homepage https://github.com/saasscaleup/laravel-stream-log
Informations about the package laravel-stream-log
Easily stream your Laravel application logs to the frontend in real-time using server-sent event (SSE)
Youtube · Twitter · Facebook · Buy Me a Coffee
✨ Features
- Easily stream your Backend events from your Controllers \ Events \ Models \ Etc... .
- Easily stream your Logs (
storage/logs/laravel.log
). - Print Backend logs and events to Frontend browser
console.log(data)
Requirements
- PHP >= 7
- Laravel >= 5
Installation
Install composer package (dev)
Via Composer - Not recommended for production environment
For Laravel < 5.5
Add Service Provider to config/app.php
in providers
section
Add Facade to config/app.php
in aliases
section
Publish package's config, migration and view files
Publish package's config, migration and view files by running below command:
Run migration command
Run php artisan migrate
to create stream_logs
table.
Setup Laravel Stream Log -> LSL
Aadd this in your main view/layout (usually layout/app.blade.php
) file:
Configuration
Configuration is done via environment variables or directly in the configuration file (config/lsl.php
).
Usage
Syntax:
To show popup notifications on the screen, in your controllers/event classes, you can do:
Customizing Notification Library
By default, package uses noty for showing notifications.
You can switch to izitoast by updating config file config/lsl.php
You can also, customize this by modifying code in resources/views/vendor/lsl/view.blade.php
file.
Customizing LSL Events
By default, pacakge uses stream
event type for streaming response:
Notice $event = 'stream'
. You can customize this, let's say you want to use UserPurchase
as SSE event type:
Then you need to handle this in your view yourself like this:
License
Please see the MIT for more information.
Support 🙏😃
If you Like the tutorial and you want to support my channel so I will keep releasing amzing content that will turn you to a desirable Developer with Amazing Cloud skills... I will realy appricite if you:
Thanks for your support :)