PHP code example of michael-orenda / logging

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

    

michael-orenda / logging example snippets


Logger::activity('user_logged_in', ['user_id' => $user->id]);
Logger::security('unauthorized_access', ['ip' => $ip]);
Logger::error('payment_failed', ['order_id' => $orderId]);

use Loggable;

class User extends Model
{
    use Loggable;
}
bash
php artisan vendor:publish --tag=logging-config
bash
php artisan migrate