PHP code example of dennisbusk / debug-notary

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

    

dennisbusk / debug-notary example snippets


use Dennisbusk\DebugNotary\Facades\DebugNotary;

try {
    // Some logic that might fail
} catch (\Exception $e) {
    DebugNotary::error($e->getMessage(), [
        'cart' => $cart->toArray(),
        'checkout_step' => 'payment',
        'coupon_code' => $session->get('coupon')
    ]);
    throw $e;
}

DebugNotary::info('User accessed premium feature', [
    'permissions' => auth()->user()->getAllPermissions()->pluck('name'),
    'active_plan' => $user->plan_id
]);

// app/Http/Kernel.php or bootstrap/app.php (Laravel 11+)
'web' => [
    // ...
    \Dennisbusk\DebugNotary\Http\Middleware\InjectNotaryButton::class,
],

use Illuminate\Support\Facades\Gate;

Gate::define('view-debug-notary', function ($user) {
    return $user->is_admin;
});

'access_gate' => 'view-debug-notary',

use Dennisbusk\DebugNotary\Facades\DebugNotary;

DebugNotary::warning('User attempted to access a locked resource', [
    'resource_id' => 123
]);

'register_routes' => false,

use Dennisbusk\DebugNotary\DebugNotary;

Route::middleware(['auth', 'can:admin'])->group(function () {
    DebugNotary::routes();
});
bash
php artisan migrate
bash
php artisan vendor:publish --tag="debug-notary-config"
bash
php artisan debug-notary:test
bash
php artisan vendor:publish --tag="debug-notary-lang"