PHP code example of ingress-it-solutions / bugtrap

1. Go to this page and download the library: Download ingress-it-solutions/bugtrap 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/ */

    

ingress-it-solutions / bugtrap example snippets


// config/app.php
'providers' => [
    // Make this very first provider
    BugTrap\ServiceProvider::class,
    
    //...
    //...
];

use BugTrap\BugTrap;
...

public function render(Exception $e, $request)
{
    if ($this->shouldReport($e)) {
        (new BugTrap)->handle($e, $request);
    }

    return parent::report($e);
}

if (($errorView = (new BugTrap)->errorView()) !== false) {
    return $errorView;
}

/**
 * Render an exception into an HTTP response.
 *
 * @param  \Illuminate\Http\Request  $request
 * @param  \Exception  $exception
 * @return \Illuminate\Http\Response
 */
public function render($request, Exception $exception)
{
    ...

    if (($errorView = (new BugTrap)->errorView()) !== false) {
        return $errorView;
    }

    return parent::render($request, $exception);
}
bash
php artisan vendor:publish --provider="BugTrap\ServiceProvider"