PHP code example of exceptions-center / laravel

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

    

exceptions-center / laravel example snippets


public function render($request, Throwable $throwable) {
    // ...

    if($this->shouldReport($throwable)) {
        ExceptionSender::make($throwable, $request)->send() ;
    }

    return parent::render($request, $throwable);
}

/*
|--------------------------------------------------------------------------
| Exceptions' Center environment data
|--------------------------------------------------------------------------
|
| This array is used in the Exception's Center to correctly use the
| sender. These values are not nt to the Exceptions' Center.
     */
    'enabled' => env('EXCEPTION_CENTER_ENABLED', false),

    /*
     * Determine whether the threads are allowed to
     * send the request to the Exceptions' Center.
     */
    'multithreading' => true,
    
    /*
     * Determine whether an error during the sending
     * should be saved in the storage/logs/exceptions.log 
     * file.
     */
    'log' => true,

    /*
     * If you published the ExceptionSender, you need
     * to declare the path until the generated file,
     * wherever you put it.
     */
    'model' => \ExceptionsCenter\Laravel\ExceptionSender::class,
    
    /*
     * The exception destination base URL.
     */
    'url' => env('EXCEPTION_CENTER_URL'),
],
 artisan config:clear

protected $listen = [
    IncomingExceptionEvent::class => [
        IncomingExceptionListener::class
    ],
];
 artisan config:clear
app/Exceptions/Handler.php
config/app.php
app/Exceptions/ExceptionSender.php
bash
php artisan vendor:publish --tag=exception-sender
bash
php artisan exception:test

.
├── composer.json
├── LICENSE
├── README.md
└── src
    ├── API
    │   ├── Contracts
    │   │   ├── ExceptionUserContract.php
    │   │   └── Reportable.php
    │   ├── ExceptionLog.php
    │   ├── Receiver
    │   │   └── ExceptionResponse.php
    │   ├── Request
    │   │   └── cUrl.php
    │   ├── Sender
    │   │   ├── AbstractExceptionSender.php
    │   │   ├── ExceptionFormatter.php
    │   │   ├── HasExceptedParameters.php
    │   │   ├── LaravelExceptionSender.php
    │   │   └── ThreadSender.php
    │   └── UrlFormatter.php
    ├── Exceptions
    │   └── CheckExceptionCenterException.php
    ├── ExceptionsCenterServiceProvider.php
    ├── ExceptionSender.php
    └── Test
        └── ExceptionTestCommand.php

8 directories, 18 files