PHP code example of jasnita / monitor-laravel

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

    

jasnita / monitor-laravel example snippets


public function report(Exception $exception)   // Laravel 7: Throwable $exception
{
    \Jasnita\Monitor\Laravel\Integration::captureUnhandledException($exception);
    parent::report($exception);
}

use Jasnita\Monitor\Facades\Monitor;

Monitor::captureException($e);                       // laporkan exception yang Anda tangkap sendiri
Monitor::captureMessage('Saldo gateway menipis', 'warning');
Monitor::setUser(['id' => $user->id, 'email' => $user->email]);
Monitor::setTag('tenant', $tenantId);                // bisa difilter di dashboard
bash
composer monitor:install --dsn=https://<key>@monitor.jasnita.com/<dsn_id>
php artisan monitor:test
bash
composer update jasnita/monitor-laravel
php artisan config:clear
php artisan monitor:test
bash
# naikkan versi hulu di tools/upstream.json, lalu:
php tools/rebrand.php     # tarik ulang + ganti nama; gagal bila ada nama hulu tersisa
tools/test.sh             # test suite hulu (1.700+ tes) terhadap hasilnya