PHP code example of farshidrezaei / laralog

1. Go to this page and download the library: Download farshidrezaei/laralog 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/ */

    

farshidrezaei / laralog example snippets


    'db_driver' => true,
    'file_driver' => true,

LaraLog::new()
    ->level( /* 'info', 'success', 'warning', 'danger' */) //default:'info'
    ->subject( 'Subject of the action' ) //nullable
    ->message( 'Message of the action' ) //nullable
    ->user( /* true (set who did this action.), false (dont set who did this action) */ ) //default:false
    ->submit();

laralog()
    ->level( 'info')
    ->subject( 'Product' )
    ->message( "Product [$product->title]($product->id) created." )
    ->user( true )
    ->submit();

$log = laralog()
       ->level( 'info')
       ->subject( 'Product' )
       ->message( "Product Created" )
       ->user( false )
       ->submit();
 bash
php artisan vendor:publish --provider="FarshidRezaei\LaraLog"
bash
php artisan migrate