PHP code example of lanin / laravel-api-debugger

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

    

lanin / laravel-api-debugger example snippets


Lanin\Laravel\ApiDebugger\ServiceProvider::class,

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

php artisan vendor:publish --provider="Lanin\Laravel\ApiDebugger\ServiceProvider"

$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();