PHP code example of cerbero / sql-dumper

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

    

cerbero / sql-dumper example snippets


$user = ds(function () {
    return User::with('posts')->find(1);
});

return [
    HtmlDumper::class => [
        'path' => storage_path('foo.html'),
    ],
];

protected $routeMiddleware = [
    'sql.dump' => \Cerbero\SqlDumper\Http\Middleware\SqlDump::class,
];

Route::middleware('sql.dump')->get('users', function () {
    return User::all();
});

Route::middleware('sql.dump:log')->get('users', function () {
    return User::all();
});
bash
php artisan vendor:publish --tag=sql-dumper