PHP code example of bughq / bughq-laravel

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

    

bughq / bughq-laravel example snippets


use BugHQ\Laravel\Facades\BugHQ;

BugHQ::captureException($e, ['orderId' => $order->id]);
BugHQ::captureMessage('imports finished', 'info');
BugHQ::setTag('tenant', $tenant->slug);
BugHQ::setContext('order', ['id' => $order->id, 'total' => $order->total]);
BugHQ::addBreadcrumb(['category' => 'payment', 'message' => 'charge submitted']);

// config/logging.php
'channels' => [
    'bughq' => ['driver' => 'bughq', 'level' => 'error'],

    // or fan out alongside your existing channel:
    'stack' => ['driver' => 'stack', 'channels' => ['single', 'bughq']],
],
bash
> composer config repositories.bughq-php vcs https://github.com/bughq/bughq-php
> composer config repositories.bughq-laravel vcs https://github.com/bughq/bughq-laravel
> 
bash
php artisan vendor:publish --tag=bughq-config