Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel show debug query sql

// Debug SQL query
// app/Providers/AppServiceProvider.php
public function boot()
{
    //...

    $this->debugQueries();
}
protected function debugQueries()
{
    if (env('APP_DEBUG_QUERIES')) {
        DB::listen(function ($query) {
            error_log(
                "Query [$query->time ms]: $query->sql
"
                . "Params: " . print_r($query->bindings, true)
            );
        });
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: php convert string to boolean 
Php :: how to collapse array in laravel 
Php :: how to add sidebar to page.php 
Php :: cloudinary laravel 
Php :: laravel password encryption 
Php :: php switch case multiple values per line 
Php :: laravel print to log 
Php :: php laravel between dates 
Php :: paystack gateway integration laravel 
Php :: route closure function in laravel 
Php :: How to check if email exists in laravel login 
Php :: wp tax_query in 
Php :: get id by url wordpress 
Php :: installing php on ubuntu 
Php :: get current month php 
Php :: laravel starter kit installation 
Php :: get where different laravel 
Php :: curl get response headers php 
Php :: destrroy a session php 
Php :: email configuration for gmail in laravel 
Php :: Laravel Excel numbers formatted as text still appearing as number 
Php :: how to completely delete php 
Php :: laravel artisan call with confirm 
Php :: export PATH=/Applications/MAMP/bin/php/php5.4.10/bin:$PATH 
Php :: php artisan test 
Php :: install php 5.6 mac 
Php :: php echo new line terminal 
Php :: php get this week date range 
Php :: laravel hasmany 
Php :: wordpress log errors 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =