Output Eloquent Builder SQL to Your Favorite Debugging Tool
Published on by Paul Redmond
Laravel showsql is a package to output model SQL queries to your favorite debugging tool or the browser:
Menu::whereHas('status') ->showSql() ->get();
When you call the showSql()
method, it sends the generated SQL query to either Laravel Telescope, Laravel Log, Ray, Clockwork, Laravel Debugbar, and web browsers. You can configure this package to send SQL queries to multiple places:
This package is helpful when you want to target specific query logs without combing through all SQL queries on a given request. You can learn more about this package, get full installation instructions, and view the source code on GitHub.