Answers for "eloquent get sql query"

PHP
6

print last sql query laravel

DB::enableQueryLog(); // Enable query log

// Your Eloquent query executed by using get()

dd(DB::getQueryLog()); // Show results of log
Posted by: Guest on May-09-2020
1

laravel get sql query eloquent with parameters

$query->toSql();

$query->getBindings()
Posted by: Guest on February-12-2021
0

laravel find query

$model = App\Models\Flight::where('legs', '>', 100)->firstOr(function () {
        // ...
});
Posted by: Guest on October-08-2020

Browse Popular Code Answers by Language