How to get last executed mysql query in Laravel?

When we are working on any projects then many times we need to get last executed query, If you are working on laravel framework and use laravel query builder And want to get last executed mysql query from laravel. 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.

 

Leave a Comment