PHP code example of threefilms / laravel-query-dump

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

    

threefilms / laravel-query-dump example snippets




use ThreeFilms\LaravelQueryDump\QueryDump;
use Illuminate\Support\Facades\DB;

// [1/2] enable QueryLog
QueryDump::enableQueryLog();

DB::table('posts')->where('author_id', '=', 12)->limit(10)->get();

// [2/2] Query Dump
QueryDump::dd();



use Illuminate\Support\Facades\DB;

// [1/2] enable QueryLog
qd_enable();

DB::table('posts')->where('author_id', '=', 12)->limit(10)->get();

// [2/2] Query Dump
qd_dd();