<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Blog Posts on Milwaukee Web Developer, PHP and Laravel Programmer, Consultant</title>
    <link>https://aaronsaray.com/blog/</link>
    <description>Recent content in Blog Posts on Milwaukee Web Developer, PHP and Laravel Programmer, Consultant</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <copyright>This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.</copyright>
    <lastBuildDate>Thu, 12 Mar 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://aaronsaray.com/blog/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Laravel 201 Created JSON With Location Header</title>
      <link>https://aaronsaray.com/2026/laravel-201-created-json-with-location-header/</link>
      <pubDate>Thu, 12 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://aaronsaray.com/2026/laravel-201-created-json-with-location-header/</guid>
      <description>&lt;p&gt;Each API seems to be different. However, there are some best practices that we should all try to follow.&lt;/p&gt;&#xA;&lt;p&gt;One of those that I really like is the 201 Created HTTP response. If the object is created immediately, you may even return the full object contents.&lt;/p&gt;&#xA;&lt;p&gt;In some cases, we don&amp;rsquo;t have the data or don&amp;rsquo;t want to return the full payload. We can return null with a location header. Here&amp;rsquo;s how to do that with Laravel.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fixing PHPStorm when Git Stops Responding</title>
      <link>https://aaronsaray.com/2026/fixing-phpstorm-when-git-stops-responding/</link>
      <pubDate>Thu, 26 Feb 2026 00:00:00 +0000</pubDate>
      <guid>https://aaronsaray.com/2026/fixing-phpstorm-when-git-stops-responding/</guid>
      <description>&lt;p&gt;PHPStorm suddenly stopped recognizing my git repository. I cleared the cache, restarted the IDE, but nothing helped. I jumped to my terminal, ran git from the command line, and everything worked fine there. Confusing, right?&lt;/p&gt;&#xA;&lt;p&gt;Let me explain why this happened and how I fixed it for good.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why Im Not Writing About AI Yet</title>
      <link>https://aaronsaray.com/2026/why-im-not-writing-about-ai-yet/</link>
      <pubDate>Wed, 18 Feb 2026 15:29:34 -0600</pubDate>
      <guid>https://aaronsaray.com/2026/why-im-not-writing-about-ai-yet/</guid>
      <description>&lt;p&gt;AI is everywhere - and it has been for the last months&amp;hellip; the last year(s)&amp;hellip; I even use it now a lot as a tool for my development. So why haven&amp;rsquo;t I published AI guidance or written about it at all?&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s really a simple reason. And it&amp;rsquo;s not what you think probably.  I&amp;rsquo;m not a hater. It&amp;rsquo;s extreme love of AI and technology that makes me wait. Let me explain.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using a Laravel Factory State to Add a Spatie Role</title>
      <link>https://aaronsaray.com/2026/using-a-laravel-factory-state-to-add-a-spatie-role/</link>
      <pubDate>Fri, 09 Jan 2026 00:00:00 +0000</pubDate>
      <guid>https://aaronsaray.com/2026/using-a-laravel-factory-state-to-add-a-spatie-role/</guid>
      <description>&lt;p&gt;I love the &lt;a href=&#34;https://spatie.be/docs/laravel-permission/v6/introduction&#34;&gt;Spatie Laravel Permissions&lt;/a&gt; package. I use it in almost all of my Laravel projects.&lt;/p&gt;&#xA;&lt;p&gt;When testing, I&amp;rsquo;ll need to set up users with various different roles and permissions. Usually, I&amp;rsquo;m using an Eloquent Factory in order to accomplish this.&lt;/p&gt;&#xA;&lt;p&gt;But it&amp;rsquo;s a little different when you&amp;rsquo;re dealing with relationships. Let&amp;rsquo;s find out how.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Customize Laravel Ide Helper to Autocomplete Blade Files</title>
      <link>https://aaronsaray.com/2025/customize-laravel-ide-helper-to-autocomplete-blade-files/</link>
      <pubDate>Wed, 17 Dec 2025 00:00:00 +0000</pubDate>
      <guid>https://aaronsaray.com/2025/customize-laravel-ide-helper-to-autocomplete-blade-files/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m working with &lt;a href=&#34;https://github.com/yajra/laravel-datatables&#34;&gt;Yajra DataTables&lt;/a&gt; in a Laravel project and I&amp;rsquo;ve ran into a little bit of a headache. They provide their own &lt;code&gt;render()&lt;/code&gt; method, which you pass a blade file to as the first parameter. Something like &lt;code&gt;users.dogs.index&lt;/code&gt; - and through that mechanism it loads the proper blade for the datatable.&lt;/p&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s the problem, though. I can&amp;rsquo;t get auto complete and I can&amp;rsquo;t click through on that in PHPStorm. But I want to. Let&amp;rsquo;s find out how.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Phpstorm Terminal LC_ALL Error Fix</title>
      <link>https://aaronsaray.com/2025/phpstorm-terminal-lcall-error-fix/</link>
      <pubDate>Fri, 05 Dec 2025 15:39:43 -0600</pubDate>
      <guid>https://aaronsaray.com/2025/phpstorm-terminal-lcall-error-fix/</guid>
      <description>&lt;p&gt;When a new terminal opens in PHPStorm on macOS, I was getting a weird error: &lt;code&gt;bash: warning: setlocale: LC_ALL: cannot change locale (en_US-u-hc-h12-u-ca-gregory-u-nu-latn): Invalid argument.&lt;/code&gt;. Strange, I use Oh My Zsh with the Zsh shell. Why am I getting that error? Why bash?  I could ignore it each time - but I wanted a fix.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Github Workflow for Production Merge</title>
      <link>https://aaronsaray.com/2025/github-workflow-for-production-merge/</link>
      <pubDate>Tue, 18 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://aaronsaray.com/2025/github-workflow-for-production-merge/</guid>
      <description>&lt;p&gt;Github actions are awesome. In fact, we often write about them or share details on &lt;a href=&#34;https://masteringlaravel.io&#34;&gt;MasteringLaravel.io&lt;/a&gt; in the tips section or the community.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s take a look at one particular workflow that appears pretty simple - after you understand it all.&lt;/p&gt;&#xA;&lt;p&gt;How do we merge from develop into main for a production deploy or merge? By using this Github action.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Stopping Laravel SQL Injection with sole()</title>
      <link>https://aaronsaray.com/2025/stopping-laravel-sql-injection-with-sole/</link>
      <pubDate>Fri, 07 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://aaronsaray.com/2025/stopping-laravel-sql-injection-with-sole/</guid>
      <description>&lt;p&gt;I love using Eloquent&amp;rsquo;s &lt;code&gt;sole()&lt;/code&gt; method in Laravel. It throws an exception if the result set is ever more than 1. It means you should only have a sole record. This is usually what I want. I&amp;rsquo;ve migrated away from &lt;code&gt;firstOrFail()&lt;/code&gt; unless I legitimately want the first of a matching set.&lt;/p&gt;&#xA;&lt;p&gt;But I just found another reason to love using the sole method - it helps add a layer of protection against SQL injection. Let&amp;rsquo;s find out how.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Deep Dive Into Print Css Headers and Footers</title>
      <link>https://aaronsaray.com/2025/a-deep-dive-into-print-css-headers-and-footers/</link>
      <pubDate>Thu, 23 Oct 2025 00:00:00 +0000</pubDate>
      <guid>https://aaronsaray.com/2025/a-deep-dive-into-print-css-headers-and-footers/</guid>
      <description>&lt;p&gt;For a project I&amp;rsquo;m working on, I had to become very familiar with the print CSS styles for headers and footers. The goal is two fold: 1) to have a nice printable version and 2) to use a chrome-pdf tool to download as PDF.&lt;/p&gt;&#xA;&lt;p&gt;Regardless of the two consuming sources, I just wanted to solve this all as one html/css file. So, it was necessary to explore all of the different options we have now, in 2025, on Chrome.&lt;/p&gt;&#xA;&lt;p&gt;In this blog entry, see print (pdf) versions of the different header/footer functionality in CSS including built-in page margin and header/footer tools as well as fixed/forced hacks.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why You Might Want to Hydrate Models to Delete Them in Laravel</title>
      <link>https://aaronsaray.com/2025/why-you-might-want-to-hydrate-models-to-delete-them-in-laravel/</link>
      <pubDate>Wed, 15 Oct 2025 00:00:00 +0000</pubDate>
      <guid>https://aaronsaray.com/2025/why-you-might-want-to-hydrate-models-to-delete-them-in-laravel/</guid>
      <description>&lt;p&gt;There are many ways to handle cascading functionality in Laravel. You can do this with observers, events, manually dispatched jobs - even in MySQL with cascading deletes.&lt;/p&gt;&#xA;&lt;p&gt;I prefer to keep my cascading logic in the application code by using Eloquent Model Events. This is super easy when it&amp;rsquo;s just a single level of model. But what about relationships?&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
