PHP code example of justbetter / laravel-error-logger

1. Go to this page and download the library: Download justbetter/laravel-error-logger 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/ */

    

justbetter / laravel-error-logger example snippets


use JustBetter\ErrorLogger\Jobs\ErrorNotificationJob;

$schedule->job(ErrorNotificationJob::class)->dailyAt('09:00');

use JustBetter\ErrorLogger\Models\Error;

Error::log()
    ->withGroup('Magento')
    ->withMessage('Something went wrong!')
    ->withDetails('Extra information of this log!')
    ->withThrowable($exception)
    ->withChannel('slack')
    ->withModel($model)
    ->save();
shell
php artisan vendor:publish --provider="JustBetter\ErrorLogger\ServiceProvider"
shell
php artisan migrate

LARAVEL_ERROR_NOTIFICATION_CHANNEL=slack
shell
php artisan laravel-error-logger:prune --all
php artisan laravel-error-logger:prune --hours=720