Does Laravel keep a log of executed SQL queries?

  • 7 августа 2023 г. 7:22
Ответы на вопрос 1
By default, Laravel does not keep a log of executed SQL queries. However, Laravel offers a way to log queries for debugging purposes. 

You can call `DB::enableQueryLog()` method to start logging executed queries. And then `DB::getQueryLog()` to retrieve an array of the executed queries.

Please note that this should be used only for debugging. Keeping the query log enabled for all your requests could quickly eat up your memory in case your application becomes busy.
Похожие вопросы