PHP code example of saasscaleup / laravel-stream-log

1. Go to this page and download the library: Download saasscaleup/laravel-stream-log 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/ */

    

saasscaleup / laravel-stream-log example snippets


Saasscaleup\LSL\LSLServiceProvider::class,

'LSL' => Saasscaleup\LSL\Facades\LSLFacade::class,

@

/**
* @param string $message : notification message
* @param string $type : alert, success, error, warning, info, debug, critical, etc...
* @param string $event : Type of event such as "EmailSent", "UserLoggedIn", etc
 */
LSLFacade::notify($message, $type = 'info', $event = 'stream')

use Saasscaleup\LSL\Facades\LSLFacade;

public function myFunction()
{

    LSLFacade::notify('Invoke stream log via Facade 1');

    // Some code here

    LSLFacade::notify('Invoke stream log via Facade 2');

    // Some code here

    LSLFacade::notify('Invoke stream log via Facade 3');
    
    // or via helper
    stream_log('Invoke stream log via helper 1');
    stream_log('Invoke stream log via helper 2');     
    stream_log('Invoke stream log via helper 3');
}

LSLFacade::notify($message, $type = 'info', $event = 'message')

use Saasscaleup\LSL\Facades\LSLFacade;

public function myMethod()
{
    SSEFacade::notify('User purchase plan - step 1', 'info', 'UserPurchase');
    
    // or via helper
    stream_log('User purchase plan - step 1', 'info', 'UserPurchase');
}
bash
$ php artisan vendor:publish --provider="Saasscaleup\LSL\LSLServiceProvider"
bash
$ php artisan migrate