How to get last executed mysql query in laravel ?By Hardik Savani | January 11, 2016 | | 1829 Viewer | Category : Laravel MySql
If you are working on laravel framwork and you use query builder of laravel 5. but you want to get last executed mysql query from laravel. If you are working on laravel 5 then you have to first enable query log that way it can be store query log. At last getQueryLog() through you can get last executed query.
I give you example of how to get last executed mysql query. you can use example as following example.
public function querylog()
$item = Item::find(2);
$last_query = DB::getQueryLog();
- How to scrolling table with fixed header in HTML?
- Laravel 5 Ajax CRUD with Pagination example and demo from scratch
- How to integrate jQuery Fullcalendar using Bootstrap, PHP and MySQL ?
- How to set scroll to bottom in jquery?
- Twitter Bootstrap - Digital Clock picker with AM PM example using clockface plugin
- Laravel after login, redirect back to previous url ?
- How to use elasticsearch from scratch in laravel 5?
- Paypal payment gateway integration in php source code example