PHP code example of saad / api-debugger

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

    

saad / api-debugger example snippets


// bootstrap/app.php
 $app->register(Lanin\Laravel\ApiDebugger\ServiceProvider::class);

// bootstrap/app.php
 $app->configure('api-debugger');

Lanin\Laravel\ApiDebugger\ServiceProvider::class,

'Debugger' => Lanin\Laravel\ApiDebugger\Facade::class,

$data = [
    'foo' => 'bar',
    'baz' => 1,
];

return response()->json([
    'data' => [
        'foo' => 'bar',
        'baz' => 1,
    ],
]);

$foo = 'foo';
$bar = [1, 2, 'bar'];

// As a helper
lad($foo, $bar);

// or as a facade
\Debugger::dump($foo, $bar);

Debugger::profileMe('event-name', function () {
    sleep(1);
});

Debugger::startProfiling('event-name');
usleep(300);
Debugger::stopProfiling('event-name');

lad_pr_start();
lad_pr_stop();
lad_pr_me();