How to Get Last Executed Query in Laravel 9?
https://www.itsolutionstuff.com/post/how-to-get-last-executed-query-in-laravel-9example.html
In this quick example, let's see Laravel 9 Eloquent Get Query Log Example. This tutorial will give you a simple example of getting sql query in laravel 9. This post will give you a simple example of laravel 9 print last sql query. This article will give you a simple example of laravel 9 eloquent print last query.
I will print last sql query in laravel 9 using toSql(), DB::enableQueryLog() and DB::getQueryLog(). i will also show you output of print sql query.
So, let's see the examples below and use them as you want anyone.
Example 1:
Controller Code:
Output:
Example 2:
Controller Code:
Output:
Example 3:
Controller Code:
Output:
Read Also: Laravel 9 Drag and Drop File Upload with Dropzone JS
I hope it can help you...
Last updated