<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Max Kosenko</title>
    <description>The latest articles on DEV Community by Max Kosenko (@max_kosenko_9a966af092572).</description>
    <link>https://dev.to/max_kosenko_9a966af092572</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3820652%2F15c27369-d41f-463b-b758-7e7a976ff4ff.jpg</url>
      <title>DEV Community: Max Kosenko</title>
      <link>https://dev.to/max_kosenko_9a966af092572</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/max_kosenko_9a966af092572"/>
    <language>en</language>
    <item>
      <title>Stop N+1 and slow Queries from Killing Your Laravel Production Performance</title>
      <dc:creator>Max Kosenko</dc:creator>
      <pubDate>Thu, 12 Mar 2026 15:49:42 +0000</pubDate>
      <link>https://dev.to/max_kosenko_9a966af092572/stop-n1-and-slow-queries-from-killing-your-laravel-production-performance-5565</link>
      <guid>https://dev.to/max_kosenko_9a966af092572/stop-n1-and-slow-queries-from-killing-your-laravel-production-performance-5565</guid>
      <description>&lt;p&gt;Hi everyone! I’ve just released Eloquent Guard, a production-ready monitor for Laravel that catches performance bottlenecks exactly where they happen.&lt;br&gt;
🛡️ Why I built this&lt;br&gt;
Standard Laravel logs often hide the real cause of performance drops. I wanted a tool that not only detects issues but tells you exactly which file and line triggered them, while ignoring the vendor/ noise.&lt;br&gt;
✨ Key Features:&lt;br&gt;
-N+1 Detection: Finds repeated queries within a single request automatically.&lt;br&gt;
-Slow Query Monitor: Alerts you when a query exceeds your custom threshold.&lt;br&gt;
-Smart Backtrace: Pinpoints the exact line of code in your routes or controllers.&lt;br&gt;
-Multi-channel Reporting: Built-in support for Slack, Telegram, Sentry, and Logs.&lt;br&gt;
-Pulse Integration: Includes a custom card for the Laravel Pulse dashboard to visualize trends.&lt;br&gt;
🚀 Quick Example&lt;br&gt;
It works out of the box. Once installed, you get alerts like this in your logs or Slack:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="err"&gt;Eloquent&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Guard:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;N+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;detected!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"sql"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"select * from users..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"count"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"source"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"/routes/web.php:9"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;Eloquent&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Guard:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Slow&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Query!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"sql"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"SELECT SLEEP(1)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"duration"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"1000.47ms"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"source"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"/var/www/html/routes/web.php:13"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📊 Laravel Pulse Support&lt;br&gt;
If you are using Laravel Pulse, you can add a dedicated card to see your alerts live:&lt;br&gt;
&lt;code&gt;&amp;lt;livewire:maxis.eloquent-guard cols="4" /&amp;gt;&lt;/code&gt;&lt;br&gt;
Links:&lt;br&gt;
GitHub: &lt;a href="https://github.com/Maxiz88/laravel-eloquent-guard" rel="noopener noreferrer"&gt;https://github.com/Maxiz88/laravel-eloquent-guard&lt;/a&gt;&lt;br&gt;
Packagist: &lt;a href="https://packagist.org/packages/maxis/laravel-eloquent-guard" rel="noopener noreferrer"&gt;https://packagist.org/packages/maxis/laravel-eloquent-guard&lt;/a&gt;&lt;br&gt;
I'd love to hear your thoughts! Does this fit into your workflow, or are there any specific reporters (like Discord or Teams) you'd like to see added?&lt;br&gt;
Thanks for checking it out!&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>sql</category>
      <category>eloquent</category>
      <category>php</category>
    </item>
  </channel>
</rss>
