<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Danny Mills on Medium]]></title>
        <description><![CDATA[Stories by Danny Mills on Medium]]></description>
        <link>https://medium.com/@danjamesmills?source=rss-9b7e3cfc1d52------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FESIg-c0_NGleQrhxOKK2Q.jpeg</url>
            <title>Stories by Danny Mills on Medium</title>
            <link>https://medium.com/@danjamesmills?source=rss-9b7e3cfc1d52------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:30:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@danjamesmills/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Single Source of Truth: How I Use the Singleton Pattern in Laravel]]></title>
            <link>https://medium.com/@danjamesmills/the-single-source-of-truth-how-i-use-the-singleton-pattern-in-laravel-a6bb96778e2d?source=rss-9b7e3cfc1d52------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6bb96778e2d</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Danny Mills]]></dc:creator>
            <pubDate>Wed, 03 Jun 2026 11:39:54 GMT</pubDate>
            <atom:updated>2026-06-03T11:39:54.565Z</atom:updated>
            <content:encoded><![CDATA[<p>When you are building applications, most of the classes you write are meant to be spun up over and over again. Every time a user requests a data model or a new form validation routine, Laravel happily creates a fresh instance (an instance is a live, individual copy of a class built in your server’s memory) uses it, and throws it away.</p><p>But sometimes, creating multiple instances of a class is the worst thing you could possibly do.</p><p>Some tools in your application need to be an absolute single source of truth. If you have more than one instance of them running at the same time, your data gets out of sync, your server resources get wasted, and your application starts behaving completely unpredictably.</p><p>To solve this, we use the <strong>Singleton Pattern</strong>. In this guide, I am going to show you the danger of ignoring this pattern using a real world example, how to implement it cleanly, and how Laravel handles singletons natively out of the box.</p><h3>What is the Singleton Pattern?</h3><p>The Singleton is a creational design pattern (a programming blueprint focused entirely on how objects are created) that guarantees a class has <strong>only one single instance</strong> across your entire application lifecycle, while providing a single global point of access to it.</p><p>Think of it like the electrical panel in your house. You do not want every room to install its own separate, competing electrical grid. You want one centralised panel that every room connects to so that power is managed safely from a single source.</p><h3>The Big Mistake: Spawning Multiple Connection Clients</h3><p>Imagine you are building a feature that connects to a high speed external caching server or a specialised system resource, like a custom print server or an API log aggregator.</p><p>Every time you instantiate (instantiate means using the new keyword to build an actual working copy of a class) that connection client, it has to perform a network handshake, exchange security keys, and hold open an expensive socket (a socket is a dedicated network pipe held open between your server and an outside service).</p><p>Here is how a standard controller looks when a developer runs code without restricting object creation:</p><pre>namespace App\Http\Controllers;<br><br>use App\Services\HighSpeedCacheClient;<br>use Illuminate\Http\Request;<br>class DashboardController extends Controller<br>{<br>    public function index(Request $request)<br>    {<br>        // ❌ The Messy Mistake: Creating separate instances manually<br>        $cacheOne = new HighSpeedCacheClient();<br>        $cacheOne-&gt;set(&#39;user_status&#39;, &#39;active&#39;);<br>        // ... some other application logic happens here ...<br>        $cacheTwo = new HighSpeedCacheClient();<br>        $userStatus = $cacheTwo-&gt;get(&#39;user_status&#39;);<br>        return response()-&gt;json([&#39;status&#39; =&gt; $userStatus]);<br>    }<br>}</pre><h4>Why this approach is terrible for your server:</h4><ul><li><strong>Massive Resource Waste:</strong> In this single HTTP request, we opened two completely separate network connections to the exact same external server. If 500 users hit this controller at the same time, your server will open 1,000 loose connections, quickly exhausting your system memory and crashing the external cache API limits.</li><li><strong>State Mismatch Risk:</strong> If $cacheOne stores data in local memory before pushing it to the cloud, $cacheTwo will have absolutely no idea that data exists because it lives in a completely different object instance. Your data falls entirely out of sync.</li></ul><h3>The Clean Rewrite: Implementing a Singleton Natively</h3><p>To enforce a singleton manually in pure PHP, you make the constructor private so nobody can use the new keyword outside the class, and you control instantiation through a static method (a static method is a function on a class that can be called directly without building a copy of the class first).</p><pre>namespace App\Services;<br><br>class HighSpeedCacheClient<br>{<br>    private static ?self $instance = null;<br>    private array $localMemoryStore = [];<br>    // 1. Lock the door. Nobody can use &#39;new HighSpeedCacheClient()&#39; anymore<br>    private function __construct() <br>    {<br>        // Expensive connection handshake happens here once<br>    }<br>    // 2. Control object creation through a single access point<br>    public static function getInstance(): self<br>    {<br>        if (self::$instance === null) {<br>            self::$instance = new self();<br>        }<br>        return self::$instance;<br>    }<br>    public function set(string $key, mixed $value): void<br>    {<br>        $this-&gt;localMemoryStore[$key] = $value;<br>    }<br>    public function get(string $key): mixed<br>    {<br>        return $this-&gt;localMemoryStore[$key] ?? null;<br>    }<br>}</pre><h3>The Proof: Confirming It is the Exact Same Instance</h3><p>To prove this works, you can fetch the class twice and check if the variables match. In PHP, using the triple equals operator (===) on two objects checks if they point to the exact same space in your server&#39;s memory.</p><pre>// Fetching our singleton twice<br>$cacheOne = HighSpeedCacheClient::getInstance();<br>$cacheTwo = HighSpeedCacheClient::getInstance();<br><br>// Let&#39;s modify the data inside the first variable<br>$cacheOne-&gt;set(&#39;connection_status&#39;, &#39;connected&#39;);<br><br>// Now let&#39;s read from the second variable<br>echo $cacheTwo-&gt;get(&#39;connection_status&#39;); // Output: &#39;connected&#39;<br><br>// The Ultimate Proof: Are they the identical memory allocation?<br>if ($cacheOne === $cacheTwo) {<br>    echo &quot;They are the exact same instance!&quot;; // This will print!<br>}</pre><p>Because of our private constructor lock, it is physically impossible to create an out of sync copy. Both $cacheOne and $cacheTwo are looking at the exact same data bucket in memory.</p><h3>The Laravel Way: Using the IoC Container</h3><p>While the manual PHP implementation works, writing private constructors makes your code very rigid and makes automated testing a nightmare because you cannot easily swap out fake versions of your tools.</p><p>Laravel solves this beautifully. It allows you to write standard, plain PHP classes <strong>without</strong> any private locks or static getInstance() methods, offloading the entire singleton management to the <strong>Service Container</strong> (the Service Container, or IoC container, is Laravel&#39;s central box for managing class dependencies and creation blueprints) using $this-&gt;app-&gt;singleton().</p><h4>Step 1: Write a Plain PHP Class</h4><p>Notice how simple this class is. We do not use private constructors or static instances here. It is just a normal class.</p><pre>namespace App\Services;<br><br>class HighSpeedCacheClient<br>{<br>    public function __construct()<br>    {<br>        // Standard constructor, no private locks needed<br>    }<br>}</pre><h4>Step 2: Register it as a Singleton in your Service Provider</h4><p>Because our class is just a regular class, anyone could technically still type new HighSpeedCacheClient() and accidentally make multiple copies. To stop this, we tell Laravel to take control of creating it inside your AppServiceProvider.</p><pre>namespace App\Providers;<br><br>use Illuminate\Support\ServiceProvider;<br>use App\Services\HighSpeedCacheClient;<br>class AppServiceProvider extends ServiceProvider<br>{<br>    public function register(): void<br>    {<br>        // Tell Laravel to treat this class as a permanent singleton<br>        $this-&gt;app-&gt;singleton(HighSpeedCacheClient::class, function ($app) {<br>            return new HighSpeedCacheClient();<br>        });<br>    }<br>}</pre><h4>Expanding on what $this-&gt;app-&gt;singleton() actually does:</h4><p>When you use $this-&gt;app-&gt;singleton(), you are setting up a factory rule inside Laravel&#39;s brain. You are saying: <em>&quot;Hey Laravel, the very first time someone asks for </em><em>HighSpeedCacheClient, run this closure function, build the object, and save it in your internal cache pocket. Every single time anyone asks for it again during this web request, do not build a new one. Just hand them that exact same copy you made the first time.&quot;</em></p><p>Plaintext</p><pre>First Request:  Controller asks Laravel Container ──► Runs closure ──► Builds Instance #1 ──► Saves to internal pocket<br>Second Request: Service asks Laravel Container    ───────────────────────────────────────► Hands back cached Instance #1<br>Third Request:  Job asks Laravel Container        ───────────────────────────────────────► Hands back cached Instance #1</pre><p>By doing this, you do not need to write messy static code inside your class. Laravel’s container handles the singleton behavior for you completely out of sight.</p><h4>Step 3: Beautifully Simple Dependency Injection</h4><p>Now, you can type hint (type hinting means writing the class name next to a variable so Laravel knows exactly what tool to fetch) your class anywhere in your application. Laravel will automatically manage the singleton lifecycle and inject that single global instance for you.</p><pre>namespace App\Http\Controllers;<br><br>use App\Services\HighSpeedCacheClient;<br><br>class DashboardController extends Controller<br>{<br>    protected HighSpeedCacheClient $cache;<br>    // Laravel automatically looks inside its pocket and injects the global singleton right here!<br>    public function __construct(HighSpeedCacheClient $cache)<br>    {<br>        $this-&gt;cache = $cache;<br>    }<br>    public function index()<br>    {<br>        $this-&gt;cache-&gt;set(&#39;user_status&#39;, &#39;active&#39;);<br>        <br>        // Any other service pulling this class right now gets the exact same data<br>        return response()-&gt;json([&#39;status&#39; =&gt; &#39;Success&#39;]);<br>    }<br>}</pre><h3>How Laravel Uses Singletons Natively</h3><p>You interact with the Singleton pattern every single day when using Laravel. The framework uses singletons to keep its own core systems incredibly fast.</p><p>Take a look at how Laravel handles your database connections or application configuration files. When you write config(&#39;app.name&#39;) in ten different files during a single web request, Laravel does not read your hard drive ten times.</p><p>Instead, Laravel binds its core Config manager into the container as a singleton during the early boot process. The framework loads your configuration settings into memory once, and every time you use a helper or facade (a facade is a simple shortcut name pointing to an underlying tool inside Laravel&#39;s container), you are talking to that exact same instance.</p><h3>Why This Wins</h3><p>By utilising singletons via Laravel’s service container, you protect your application from architectural bloat:</p><ul><li><strong>Drastic Performance Savings:</strong> You stop opening redundant database sockets, API connections, or heavy file streams. You load the resource once and share it everywhere.</li><li><strong>Predictable State Management:</strong> Because every class is talking to the exact same instance, changes made to your singleton utility in a middleware are immediately visible to your controllers and services later in the request cycle.</li><li><strong>Test Suite Friendly:</strong> Because Laravel manages the singleton inside its container instead of using hardcoded PHP static methods, you can easily swap out the real singleton for a mock client (a mock client is a fake, dummy version of a class used to isolate code during automated testing) during automated testing using $this-&gt;instance().</li></ul><p>When you have an expensive tool or a utility that absolutely must remain a single source of truth, do not let loose instantiation clutter your server resources. Bind it as a singleton and let Laravel handle the heavy lifting safely out of sight!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6bb96778e2d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond the Single Object: How I Use the Abstract Factory Pattern in Laravel]]></title>
            <link>https://medium.com/@danjamesmills/beyond-the-single-object-how-i-use-the-abstract-factory-pattern-in-laravel-ee5afbe86111?source=rss-9b7e3cfc1d52------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee5afbe86111</guid>
            <category><![CDATA[software-design]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Danny Mills]]></dc:creator>
            <pubDate>Wed, 03 Jun 2026 11:22:04 GMT</pubDate>
            <atom:updated>2026-06-03T11:22:04.224Z</atom:updated>
            <content:encoded><![CDATA[<p>If you read my last post on the <strong>Factory Method Pattern</strong>, you already know how much I love using creational design patterns to keep my Laravel applications clean. Swapping out a single class (like switching from an Email notification driver to an SMS notification driver) using a single manager method is one of the cleanest ways to handle dynamic object creation.</p><p>But what happens when your features grow past needing just one single object?</p><p>What happens when a new business requirement demands that you generate a whole <strong>suite of completely different, matching tools</strong> that must work together seamlessly based on what a user selects?</p><p>If you try to stretch a standard factory method to handle multiple, distinct types of objects at the same time, your code quickly turns into a cluttered mess. To solve this simply, we upgrade our architecture to a streamlined <strong>Abstract Factory Pattern</strong> using a background queue and a central Manager class.</p><p>In this guide, I am going to break down how it works using a real world example, strip away the confusing technical jargon, and show you how to manage complex, interconnected toolsets across background jobs with minimal files.</p><h3>The Big Mistake: Mixing Up Your Tools manually</h3><p>Imagine you are building a social media scheduler. Your application needs to publish posts and track analytics on networks like Twitter and LinkedIn. Because these tasks take time, we want to handle them inside a background queue job.</p><p>To work properly, each network requires two distinct tools that <strong>must</strong> match perfectly:</p><ol><li>A <strong>Post</strong> tool (to handle the specific API limits and formatting for that network).</li><li>An <strong>Analytics</strong> tool (to track the specific view counts for that network).</li></ol><p>Here is how a standard background job looks when a developer tries to manage these matching dependencies manually. Notice how easy it is to make a tiny copy paste typo that ruins the entire alignment:</p><pre>namespace App\Jobs;<br><br>use App\Services\TwitterPost;<br>use App\Services\TwitterAnalytics;<br>use App\Services\LinkedInPost;<br>use App\Services\LinkedInAnalytics;<br>use Illuminate\Bus\Queueable;<br>use Illuminate\Contracts\Queue\ShouldQueue;<br>class ProcessSocialNetworkPostJob implements ShouldQueue<br>{<br>    use Queueable;<br>    public function __construct(<br>        public string $network, // &#39;twitter&#39; or &#39;linkedin&#39;<br>        public string $content<br>    ) {}<br>    public function handle(): void<br>    {<br>        // ❌ The Messy Mistake: Manual tool matching inside the Job<br>        if ($this-&gt;network === &#39;twitter&#39;) {<br>            $post = new TwitterPost();<br>            $analytics = new TwitterAnalytics();<br>        } elseif ($this-&gt;network === &#39;linkedin&#39;) {<br>            $post = new LinkedInPost();<br>            <br>            // ⚠️ THE TYPO ERROR: A developer accidentally pasted Twitter here!<br>            $analytics = new TwitterAnalytics(); <br>        } else {<br>            throw new \InvalidArgumentException(&quot;Network not supported&quot;);<br>        }<br>        // Running the tools<br>        $post-&gt;send($this-&gt;content);<br>        $analytics-&gt;track();<br>    }<br>}</pre><h4>Why this approach is dangerous:</h4><ul><li><strong>The Mismatch Risk:</strong> Because of that simple copy paste typo in the LinkedIn block, your code pairs a LinkedInPost with a TwitterAnalytics tracker. The application won&#39;t show an error while you write it, but it will crash in production because the Twitter tracker doesn&#39;t know how to look up a LinkedIn post ID</li><li><strong>Hard to Update:</strong> Every time you want to support a new network (like TikTok), you are forced to break open this background job file, append more conditional code blocks, and risk breaking your existing logic.</li></ul><h3>The Clean Rewrite: The Unified Toolkit Container</h3><p>To fix this, we create a single, simple object that represents our <strong>Toolkit</strong>. Its only job is to hold our matching tools together safely.</p><h4>Step 1: Define the Toolkit Blueprint</h4><p>First, we define a simple rulebook (an interface) for what our toolkit must contain. This ensures every network family looks and behaves identically.</p><pre>namespace App\Toolkits;<br><br>interface SocialNetworkToolkit<br>{<br>    public function post(): object;<br>    public function analytics(): object;<br>}</pre><h4>Step 2: Build the Concrete Toolkits</h4><p>Now, we build the actual toolsets for our specific networks. The TwitterToolkit is strictly isolated to constructing Twitter components, and the LinkedInToolkit handles LinkedIn.</p><pre>namespace App\Toolkits;<br><br>use App\Services\TwitterPost;<br>use App\Services\TwitterAnalytics;<br>class TwitterToolkit implements SocialNetworkToolkit<br>{<br>    public function post(): object {<br>        return new TwitterPost();<br>    }<br>    public function analytics(): object {<br>        return new TwitterAnalytics();<br>    }<br>}</pre><h3>Tying It into Laravel: The Dynamic Manager</h3><p>Instead of locking our code to a static configuration file, we can create a single <strong>SocialNetworkManager</strong> class that accepts the network choice as a dynamic parameter. This allows our background queue to handle different platforms side by side simultaneously.</p><pre>namespace App\Managers;<br><br>use App\Toolkits\SocialNetworkToolkit;<br>use App\Toolkits\TwitterToolkit;<br>use App\Toolkits\LinkedInToolkit;<br>class SocialNetworkManager<br>{<br>    // The manager dynamically switches gears based on whatever string it is handed<br>    public function toolkit(string $network): SocialNetworkToolkit<br>    {<br>        return match (strtolower($network)) {<br>            &#39;twitter&#39;  =&gt; new TwitterToolkit(),<br>            &#39;linkedin&#39; =&gt; new LinkedInToolkit(),<br>            default    =&gt; throw new \InvalidArgumentException(&quot;Network [{$network}] is not supported&quot;),<br>        };<br>    }<br>}</pre><h3>The Final Result: Beautifully Simple Execution</h3><p>Look at how simple, safe, and clean our background job becomes. We pass the dynamic network choice directly into the manager, extract the tools, and execute our logic.</p><pre>namespace App\Jobs;<br><br>use App\Managers\SocialNetworkManager;<br>use Illuminate\Bus\Queueable;<br>use Illuminate\Contracts\Queue\ShouldQueue;<br><br>class ProcessSocialNetworkPostJob implements ShouldQueue<br>{<br>    use Queueable;<br>    <br>    public function __construct(<br>        public string $network,<br>        public string $content<br>    ) {}<br>     <br>     /**<br>     * Laravel automatically injects the SocialNetworkManager here when <br>     * the queue worker handles the job.<br>     */<br>    public function handle(SocialNetworkManager $manager): void<br>    {<br>        // 1. Fetch the completely pre aligned toolkit from our manager<br>        $toolkit = $manager-&gt;toolkit($this-&gt;network);<br><br>        // 2. Grab the matching tools safely<br>        $post = $toolkit-&gt;post();<br>        $analytics = $toolkit-&gt;analytics();<br>        // 3. Execute the business logic seamlessly<br>        $post-&gt;send($this-&gt;content);<br>        $analytics-&gt;track();<br>    }<br>}</pre><p>Now, your web controller is completely unburdened. It simply drops the data onto the queue and returns a fast response:</p><pre>ProcessSocialNetworkPostJob::dispatch($request-&gt;input(&#39;network&#39;), $request-&gt;input(&#39;content&#39;));</pre><h3>Why This Wins for Developers</h3><p>By grouping your multi object creation logic behind an Abstract Toolkit pattern and moving it to the queue, you gain massive advantages without any cognitive strain:</p><ul><li><strong>Complete Error Prevention:</strong> You physically eliminate the risk of mismatched tools. The typo we saw earlier where a developer mixed Twitter and LinkedIn is now impossible because you can only request tools from a unified, pre verified toolkit.</li><li><strong>True Multi Platform Support:</strong> Your background queue can process a Twitter post, a LinkedIn post, and a TikTok post one right after the other flawlessly. Each background job handles its own specific toolkit context dynamically.</li><li><strong>Simple, Readable Code:</strong> Any beginner developer joining your team can open this background job and immediately understand exactly what it does. There are no confusing conditional loops, just a clean request for a post tool and an analytics tool.</li></ul><p>When your system scales to a point where multiple, distinct classes must share a common operational theme, stop forcing individual factory methods to handle the weight. Encapsulate the entire family behind an Abstract Toolkit and let Laravel manage the heavy lifting out of sight!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee5afbe86111" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Use the Factory Method Pattern in Laravel]]></title>
            <link>https://medium.com/@danjamesmills/how-i-use-the-factory-method-pattern-in-laravel-a90f5a498491?source=rss-9b7e3cfc1d52------2</link>
            <guid isPermaLink="false">https://medium.com/p/a90f5a498491</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Danny Mills]]></dc:creator>
            <pubDate>Tue, 02 Jun 2026 11:26:11 GMT</pubDate>
            <atom:updated>2026-06-02T11:26:11.137Z</atom:updated>
            <content:encoded><![CDATA[<p>When I build web applications, one of the biggest traps I try to avoid is making my code too rigid. If my code is locked into using specific classes, making changes down the road becomes a massive headache.</p><p>To solve this, I rely on <strong>Creational Design Patterns</strong>. These patterns are smart blueprints that handle creating objects for you so your main code doesn’t have to get its hands dirty using the new keyword.</p><p>The best tool for this job is the <strong>Factory Method Pattern</strong>. In this guide, I’m going to break down what it is, look at a real-world controller example, and show you how to tie it into Laravel’s <strong>Inversion of Control (IoC) Container</strong> and <strong>.env configuration</strong> system to swap drivers globally without touching a line of application code.</p><h3>What is a Creational Design Pattern?</h3><p>In software development, design patterns are grouped by the problems they solve. <strong>Creational patterns</strong> focus entirely on <em>how</em> objects are created.</p><p>Instead of littering my controllers with the new keyword, creational patterns handle that process out of sight.</p><p>The <strong>Factory Method</strong> specifically gives you a single manager class or method to build objects. Your main code just asks the factory for a tool, and the factory decides exactly which object to hand back based on your settings.</p><h3>The Big Mistake: Hardcoding Services in Controllers</h3><p>To see why this matters, look at a common mistake: hardcoding a service directly inside a Laravel Controller.</p><p>Imagine a CheckoutController that handles user payments. Right now, it is forced to only send receipts via Email.</p><pre>namespace App\Http\Controllers;<br><br>use App\Notifications\Channels\EmailChannel;<br>use Illuminate\Http\Request;<br><br>class CheckoutController extends Controller<br>{<br>    public function store(Request $request)<br>    {<br>        // ... Core checkout logic ...<br>        // The Problem: We are locked into using EmailChannel directly<br><br>        $notifier = new EmailChannel();<br>        $notifier-&gt;send($request-&gt;user()-&gt;email, &#39;Your order was successful!&#39;);<br>        <br>        return response()-&gt;json([&#39;message&#39; =&gt; &#39;Order processed!&#39;]);<br>    }<br>}</pre><h3>Why this breaks down:</h3><ul><li><strong>Too Tightly Linked:</strong> The CheckoutController should only care about processing an order. Instead, it has to know exactly how the email system works.</li><li><strong>Hard to Change:</strong> If the business decides users should get an SMS text instead of an email, I have to physically open this controller file and change new EmailChannel() to new SmsChannel(). If I have 10 different controllers doing this, I have to fix all 10 files.</li></ul><h3>The Solution: Using a Factory Method</h3><p>Instead of letting the controller create the object, I outsource that job to a dedicated factory class. Here is how I set it up cleanly.</p><h4>Step 1: Define the Rulebook (The Interface)</h4><p>First, I create a simple rulebook that every notification type must follow. This ensures they all work the same way.p</p><pre>namespace App\Notifications\Channels;<br><br>interface NotificationChannel <br>{<br>    public function send(string $recipient, string $message): void;<br>}</pre><h3>Step 2: Build the Tools</h3><p>Next, I write the actual code for each channel. These classes handle the actual work of sending the messages.</p><pre>namespace App\Notifications\Channels;<br><br>class EmailChannel implements NotificationChannel <br>{<br>    public function send(string $recipient, string $message): void <br>    {<br>        // Logic to send an email<br>    }<br>}<br><br>class SmsChannel implements NotificationChannel <br>{<br>    public function send(string $recipient, string $message): void <br>    {<br>        // Logic to send a text message<br>    }<br>}</pre><h3>Step 3: Create the Factory Manager</h3><p>This is where the magic happens. I create a manager class with a <strong>Factory Method</strong>. It looks at a setting and builds the correct object automatically.</p><pre>namespace App\Notifications;<br><br>use App\Notifications\Channels\NotificationChannel;<br>use App\Notifications\Channels\EmailChannel;<br>use App\Notifications\Channels\SmsChannel;<br><br>class NotificationManager <br>{<br>    /**<br>     * The Factory Method.<br>     * It builds the right tool compressed behind a single method call.<br>     */<br>    public function makeDriver(string $driver): NotificationChannel <br>    {<br>        return match ($driver) {<br>            &#39;email&#39; =&gt; new EmailChannel(),<br>            &#39;sms&#39;   =&gt; new SmsChannel(),<br>            default =&gt; throw new \InvalidArgumentException(&quot;Driver not supported&quot;),<br>        };<br>    }<br>}</pre><h3>Tying It into Laravel: .env Configuration &amp; IoC Container</h3><p>To make this completely seamless in production, I hook our factory into Laravel’s configuration files and register it inside the <strong>IoC (Inversion of Control) Container</strong> using a Service Provider. This mirrors exactly how Laravel handles its native drivers.</p><h3>1. Step 1: Add a setting to the .env file</h3><p>First, I define a new variable in my environment file to dictate the global delivery mechanism.</p><pre>NOTIFICATION_DRIVER=email</pre><h3>2. Step 2: Reference the env inside config/services.php</h3><p>Next, I map that environment variable into Laravel’s configuration array.</p><pre>return [<br>    // ... other services ...<br>    <br>    &#39;notifications&#39; =&gt; [<br>        &#39;default&#39; =&gt; env(&#39;NOTIFICATION_DRIVER&#39;, &#39;email&#39;),<br>    ],<br>];</pre><h3>3. Step 3: Register in the AppServiceProvider</h3><p>Now, I tell Laravel that whenever the application requests a NotificationChannel interface, it should look at that config value and use our factory manager to resolve the correct driver automatically.</p><pre>namespace App\Providers;<br><br>use Illuminate\Support\ServiceProvider;<br>use App\Notifications\NotificationManager;<br>use App\Notifications\Channels\NotificationChannel;<br><br>class AppServiceProvider extends ServiceProvider<br>{<br>    public function register(): void<br>    {<br>        // Bind the interface to the container<br>        $this-&gt;app-&gt;bind(NotificationChannel::class, function ($app) {<br>            $manager = $app-&gt;make(NotificationManager::class);<br>            <br>            // Pull the value we mapped from our .env file<br>            $defaultDriver = config(&#39;services.notifications.default&#39;);<br>            <br>            return $manager-&gt;makeDriver($defaultDriver);<br>        });<br>    }<br>}</pre><h3>4. The Super Clean Controller</h3><p>Because of the IoC container registration, my controller becomes incredibly simple. I just type hint the NotificationChannel interface in the constructor. Laravel automatically runs our factory method behind the scenes and hands the controller the exact driver it needs.</p><pre>namespace App\Http\Controllers;<br><br>use App\Notifications\Channels\NotificationChannel;<br>use Illuminate\Http\Request;<br><br>class CheckoutController extends Controller<br>{<br>    protected $notifier;<br>    <br>    // Laravel&#39;s container automatically resolves the correct factory driver here!<br>    public function __construct(NotificationChannel $notifier)<br>    {<br>        $this-&gt;notifier = $notifier;<br>    }<br><br>    public function store(Request $request)<br>    {<br>        // ... Core checkout logic ...<br><br>        // Send it! The controller has no idea if this is an email or SMS.<br>        $this-&gt;notifier-&gt;send($request-&gt;user()-&gt;contact_destination, &#39;Your order was successful!&#39;);<br><br>        return response()-&gt;json([&#39;message&#39; =&gt; &#39;Order processed!&#39;]);<br>    }<br>}</pre><h3>How it Ties Back to Native Laravel Features</h3><p>If this architecture feels familiar, it is because this is exactly how Laravel’s core ecosystem runs. You interact with this design every single day when using drivers like caching, database management, or file storage.</p><p>Take a look at your native .env file right now:</p><p>Code snippet</p><pre>CACHE_STORE=file<br>QUEUE_CONNECTION=database<br>SESSION_DRIVER=file</pre><p>When you write Cache::put(&#39;key&#39;, &#39;value&#39;), you aren&#39;t specifying <em>how</em> or <em>where</em> to store that data. Behind the scenes, Laravel&#39;s CacheManager class operates as a Factory. It reads your CACHE_STORE value from the .env file, constructs the correct storage engine, and injects it seamlessly.</p><p>If your boss tells you to move the application cache from file storage to a redis server, you don&#39;t rewrite a single line of application code. You open your .env file, change one line, and the factory shifts gears automatically:</p><pre>CACHE_STORE=redis</pre><h3>Why This Wins</h3><p>By separating object creation from my business logic and driving it through configuration, my code becomes incredibly flexible:</p><ul><li><strong>Zero-Touch Controller Updates:</strong> If I want to add WhatsApp notifications next week, I just build a WhatsAppChannel class, add one line to my NotificationManager factory switch map, and update my .env. My controllers stay completely untouched.</li><li><strong>Environment Isolation:</strong> I can seamlessly send notifications to a local logging file driver during local development (NOTIFICATION_DRIVER=log) and switch to a real third-party API in production (NOTIFICATION_DRIVER=sms) purely via the .env file.</li></ul><p>Laravel hides the messy creation logic behind clean factories, making my life as a developer much easier and keeping my applications ready to scale at a moment’s notice!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a90f5a498491" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Building Bridges Before You Know Where the River Is]]></title>
            <link>https://medium.com/@danjamesmills/stop-building-bridges-before-you-know-where-the-river-is-f28eb10e3753?source=rss-9b7e3cfc1d52------2</link>
            <guid isPermaLink="false">https://medium.com/p/f28eb10e3753</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[product-development]]></category>
            <category><![CDATA[saas]]></category>
            <dc:creator><![CDATA[Danny Mills]]></dc:creator>
            <pubDate>Fri, 06 Feb 2026 01:06:57 GMT</pubDate>
            <atom:updated>2026-02-06T01:06:57.218Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tSB6EpZm3zeF8RzQlnhXtw.png" /></figure><p>In the world of SaaS, we have a romanticised obsession with “The Launch.”</p><p>We envision a ribbon-cutting ceremony where the gates open, thousands of users flood in, and the architecture we spent eighteen months perfecting holds up under the weight of a million concurrent sessions. We build massive, reinforced concrete bridges architectural marvels of code only to realise upon completion that the “river” of users need has shifted three miles to the left. Or worse, there was never a river there to begin with.</p><p>If you are building a SaaS product in a vacuum, you aren’t an engineer; you’re a gambler. And the house always wins.</p><h3>I. The Fallacy of the Perfect Blueprint</h3><p>Software engineers and founders are naturally “bridge builders.” We like stability. We like 99.9% uptime. We like elegant, scalable schemas. But in the early stages of a startup, <strong>perfection is a form of procrastination.</strong></p><p>When you spend six months building a feature set without real-world telemetry, you are accruing <strong>“Ignorance Debt.”</strong> Unlike technical debt, which can be paid down with a refactor, ignorance debt is paid in the form of a dead company. You have spent your most valuable resource time on a solution for a problem that doesn’t exist.</p><h3>Why We Over-Engineer</h3><ol><li><strong>Fear of Judgment:</strong> We don’t want to be “the team that launched a buggy app.”</li><li><strong>The “One More Feature” Trap:</strong> The belief that the product is just one “killer feature” away from being ready.</li><li><strong>Scalability Anxiety:</strong> Building for a million users when you don’t have ten.</li></ol><h3>II. Defining the “River”: The Fluidity of Market Need</h3><p>The “River” is your market. It is the flow of user pain points, budget cycles, and competitor shifts. The mistake most SaaS founders make is assuming the river is a static geographical feature.</p><p>In reality, <strong>the river moves.</strong></p><p>If you spend two years building a “bridge” (a full-scale enterprise platform), you are betting that the market’s needs won’t change in 730 days. In SaaS, two years is an eternity. By the time you’re done, a leaner competitor has already built a “raft” (a simple MVP), sailed across the river, and claimed the territory on the other side.</p><h3>Identifying the Current</h3><p>Before you write a single line of “bridge-grade” code, you must test the current.</p><ul><li><strong>The Landing Page Test:</strong> Can you sell the <em>idea</em> before the product exists?</li><li><strong>The Wizard of Oz MVP:</strong> Can you perform the service manually behind the scenes while the user thinks it’s automated?</li><li><strong>The Concierge MVP:</strong> Can you solve the problem for one person, by hand, at a high price point?</li></ul><h3>III. The Raft Mentality: Minimum vs. Viable</h3><p>The “M” in MVP is often misunderstood. “Minimum” does not mean “broken.” It means the smallest possible set of functional tools that allows a user to complete a core task.</p><p>Think of it as a <strong>Raft</strong>.</p><ul><li>A bridge is permanent, expensive, and slow to build.</li><li>A raft is temporary, cheap, and fast.</li><li>Crucially: <strong>Both get you across the water.</strong></li></ul><p>If your SaaS is a project management tool, the “Raft” isn’t a broken UI. The Raft is a simple list that saves to a database. It doesn’t need “Dark Mode,” it doesn’t need “Slack Integration,” and it certainly doesn’t need “AI-driven productivity forecasting.” It just needs to save the list.</p><h3>The Viability Threshold</h3><p>Your product is “Viable” when the value it provides outweighs the friction of using a new, unpolished tool. If the user’s “river” is deep and dangerous enough, they won’t care if the raft is made of mismatched logs they just want to get across.</p><h3>IV. The Architecture of Iteration</h3><p>Once you have users on your raft, they will start telling you where the river actually goes. This is the <strong>Feedback Loop</strong>, and it is the only true “Blueprint” in software development.</p><p><strong>Build </strong>Release the smallest functional increment. Get data, not praise.</p><p><strong>Measure </strong>Track what users <em>do</em>, not what they <em>say</em>. Find the “Aha!” moment.</p><p><strong>Learn </strong>Pivot or persevere. Reduce “Ignorance Debt.”</p><h3>Case Study: The Dropbox Bridge</h3><p>Drew Houston didn’t build the complex file-syncing architecture first. He made a <strong>video</strong>. He showed the “bridge” in a three-minute screencast. The “river” responded with 75,000 sign-ups overnight. He didn’t build the bridge until he knew exactly how many people were waiting to cross it.</p><h3>V. Fighting the “Polishing” Instinct</h3><p>In a 3,000-word deep dive, we have to address the “Internal Resistance.” Your lead dev will want to refactor the API. Your designer will want to fix the kerning on the H2 tags.</p><p><strong>You must resist.</strong></p><p>Every hour spent polishing a feature that hasn’t been validated is an hour stolen from the feature that might actually save your company.</p><blockquote><em>“If you aren’t embarrassed by the first version of your product, you shipped too late.” — Reid Hoffman.</em></blockquote><h3>The “Bridge-Builder’s” Checklist</h3><p>Before adding a feature, ask:</p><ol><li>Does this help the user cross the river <em>today</em>?</li><li>Can I build this in 48 hours?</li><li>If this feature failed, would the product still be “viable”?</li></ol><h3>VI. Conclusion: Become a Navigator, Not Just a Builder</h3><p>Building a SaaS is not a construction project; it’s an expedition.</p><p>The goal isn’t to have the most beautiful bridge on the horizon. The goal is to get your users to the other side of their problems as efficiently as possible. When you stop obsessing over the “bridge” and start studying the “river,” you realise that the most successful products aren’t the ones that were perfectly planned they’re the ones that were agile enough to move when the water shifted.</p><p>Stop building. Start floating. Find the river first.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f28eb10e3753" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Email is Hard; Postmark Makes it Easy (And Fast)]]></title>
            <link>https://medium.com/@danjamesmills/email-is-hard-postmark-makes-it-easy-and-fast-f7dbf6731bd5?source=rss-9b7e3cfc1d52------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7dbf6731bd5</guid>
            <category><![CDATA[postmark]]></category>
            <category><![CDATA[laravel-framework]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[email-marketing]]></category>
            <dc:creator><![CDATA[Danny Mills]]></dc:creator>
            <pubDate>Thu, 05 Feb 2026 10:55:21 GMT</pubDate>
            <atom:updated>2026-02-05T10:55:21.605Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E6eY7HA3zcTHGAi2TkU3Jg.png" /></figure><p>If you’ve ever tried to manage your own mail server, you know the truth: <strong>Email is a nightmare.</strong> I’ve been there, staring at configuration files, battling <strong>SPF, DKIM, and DMARC</strong> records, and desperately trying to keep an IP off a blacklist. In 2026, maintaining a reliable, high-deliverability mail server is a full-time job. With the rise of advanced spam filters and strict authentication requirements, a single misstep can send your crucial transactional emails (password resets, order confirmations) straight into the abyss of the spam folder.</p><p>Honestly, after countless hours of frustration, I came to a simple conclusion: <strong>it’s just too much hard work.</strong> Especially when you consider how affordable and reliable dedicated services have become.</p><h3>Why Outsource Your Email? The “Senior” Perspective</h3><p>As developers, our time is precious. Every minute spent troubleshooting Exim or Postfix is a minute not spent building features or optimizing performance. Outsourcing your email means offloading the hardest parts of the stack:</p><ul><li><strong>IP Reputation:</strong> Providers like Postmark manage entire pools of high-reputation IP addresses, ensuring your emails bypass spam filters. They handle the complex task of “warming up” IPs and recovering from any deliverability bumps.</li><li><strong>Security &amp; Authentication:</strong> Modern email requires stringent adherence to authentication protocols (SPF, DKIM, DMARC, TLS). Specialists ensure these are perfectly configured and continuously updated.</li><li><strong>Focus on Your Core Product:</strong> Let the experts handle email so you can focus on what you do best.</li></ul><h3>The Postmark Advantage: Vetted Delivery &amp; Unbeatable Visibility</h3><p>This is where <strong>Postmark</strong> truly shines, and why I genuinely recommend them (this isn’t sponsored, I just think it’s a fantastic service). While many providers let anyone sign up and start sending, Postmark stands apart with its focus on <strong>transactional email</strong> and a <strong>strict onboarding process</strong>.</p><ul><li><strong>Protected IP Integrity:</strong> Their vetting process ensures that only legitimate senders use their shared IPs. This means you benefit from a cleaner, higher-trust sending environment, drastically improving your deliverability.</li><li><strong>Exceptional Logging &amp; Analytics:</strong> No more guessing! Postmark offers a beautiful, intuitive dashboard with comprehensive logs for every single email. You can see when it was sent, processed, opened, clicked, or bounced, giving you instant clarity on your email’s journey.</li><li><strong>Rapid Laravel Integration:</strong> For <strong>Laravel</strong> users, getting started is incredibly quick. With a built-in Postmark driver, you can go from zero to sending production-ready emails in literally minutes by just setting an API token in your .env and updating your mail.php.</li></ul><h3>The Verdict: Time is Money (and Reputation)</h3><p>The days of wrestling with your own mail server are over for most of us, especially with how robust and inexpensive dedicated services like Postmark are. Don’t sacrifice your time, sanity, or sender reputation. Focus on building the features that matter and let a specialist handle the delivery.</p><p><strong>Email is hard, but with Postmark, it doesn’t have to be.</strong></p><p><strong>Want to see how I manage my infrastructure logs in real-time? Check out my latest project on GitHub:</strong></p><p><a href="https://github.com/DanJamesMills/cloudflare-tunnel"><strong>https://github.com/DanJamesMills/cloudflare-tunnel</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7dbf6731bd5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond the Cloudflare Edge: See What’s Really Happening on Your Side of the Tunnel]]></title>
            <link>https://medium.com/@danjamesmills/beyond-the-cloudflare-edge-see-whats-really-happening-on-your-side-of-the-tunnel-896fafa1cd76?source=rss-9b7e3cfc1d52------2</link>
            <guid isPermaLink="false">https://medium.com/p/896fafa1cd76</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[cloudflare]]></category>
            <category><![CDATA[cloudflare-tunnel]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Danny Mills]]></dc:creator>
            <pubDate>Wed, 04 Feb 2026 22:46:55 GMT</pubDate>
            <atom:updated>2026-02-04T22:46:55.325Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U9mtLwHZEaIyPs9r4qwDIw.png" /><figcaption>A Docker-based dashboard designed to bridge the gap between Cloudflare’s edge and your local services. Monitor live traffic, track error rates, and inspect the health of your origin servers with a simple, secure web interface.</figcaption></figure><p>For anyone running self-hosted services, Cloudflare Tunnels are a game-changer for security and accessibility. They let you expose your local web services without opening a single port, offering a secure, encrypted path directly from Cloudflare’s edge to your private network. The Cloudflare dashboard provides a wealth of information traffic analytics, debugging details, and security insights.</p><p>But here’s the rub: that’s <em>their</em> side of the tunnel. What about <em>your</em> side?</p><p>When a request flows through your tunnel and hits your local network, you’re often left in the dark. Is the traffic actually reaching your Nginx Proxy Manager? Which backend service is handling it? Are your origin servers throwing 404s or 502s <em>before</em> Cloudflare even sees the error? Debugging these “last mile” issues can be a frustrating exercise in docker logs -f and guessing games.</p><p>That’s why I built <strong>Cloudflare Tunnel with Real-Time Dashboard</strong> an open-source, Docker-based monitoring solution that sits right on your network and gives you unparalleled visibility into your tunnel’s local activity.</p><p>Imagine:</p><ul><li><strong>Real-time traffic streams:</strong> Watch requests hit your services as they happen.</li><li><strong>Origin server insights:</strong> See precisely which backend IPs and ports are receiving traffic.</li><li><strong>Full request details:</strong> Instantly inspect client IP, country, user agent, referer, and all request headers.</li><li><strong>Immediate error detection:</strong> Spot 404s, 502s, and other origin errors the moment they occur.</li><li><strong>Tunnel resource monitoring:</strong> Keep an eye on your cloudflared container&#39;s CPU and memory usage.</li><li><strong>Instant Search &amp; Filter:</strong> Quickly find specific requests or error patterns without sifting through endless logs.</li></ul><p>Setting it up is a breeze a simple docker-compose up command, a quick setup via a secure web interface, and you&#39;re good to go. It&#39;s mobile-friendly and password-protected, so you can monitor your infrastructure from anywhere.</p><p>Stop guessing why your tunnel isn’t working as expected. Take control of the “other side” of the tunnel and gain the visibility you need to ensure your services are running flawlessly.</p><p><strong>Check out Cloudflare Tunnel with Real-Time Dashboard on GitHub today: </strong><a href="https://github.com/DanJamesMills/cloudflare-tunnel"><strong>https://github.com/DanJamesMills/cloudflare-tunnel</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=896fafa1cd76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Fighting Your Dev Environment: How I Tamed the Multi-PHP Laravel Beast]]></title>
            <link>https://medium.com/@danjamesmills/stop-fighting-your-dev-environment-how-i-tamed-the-multi-php-laravel-beast-3a077d888381?source=rss-9b7e3cfc1d52------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a077d888381</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Danny Mills]]></dc:creator>
            <pubDate>Tue, 03 Feb 2026 23:36:01 GMT</pubDate>
            <atom:updated>2026-02-03T23:36:01.875Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Ds1LWMl9tyZs1SPePXp3A.png" /></figure><p>We’ve all been there. You’re halfway through a sprint on a modern Laravel project when an urgent ticket comes in for a legacy client site running on PHP 8.1.</p><p>Suddenly, your afternoon isn’t about coding, it’s about wrestling with version managers, re-linking packages, or trying to remember why your Nginx config decided to throw a 502 error the moment you looked at it sideways.</p><p>For a long time, my solution was a hacked-together Ubuntu VM. It worked, but it was a total mess of manual configurations and “don’t touch that or it breaks” settings. I looked at Laravel Sail, but I found myself still having to configure things per-project. I didn’t want to manage a dozen different Docker setups. I just wanted one environment where I could clone a project and start working.</p><p>So, I built something better. Today, I’m sharing the beta of my <strong>Laravel Multi-Site Development Environment</strong>.</p><h3>The Goal: Install Once, Host Everything</h3><p>I wanted a setup that stayed out of my way. My workflow is simple: I use VS Code to SSH into my Ubuntu VM (which runs on my Proxmox homelab), and I want to get to work immediately.</p><p>The best part is when I have a new idea. I didn’t want to spend twenty minutes setting up a folder, a database, and a vhost just to test a theory. Now, I just run a simple script. It asks me a couple of questions, creates a fresh version of Laravel, sets up the database, and handles all the boring stuff automatically. I can go from “idea” to “coding” in seconds.</p><h3>What is Docker anyway?</h3><p>If you aren’t familiar with Docker, don’t worry. Think of it as a way to wrap an application and everything it needs the specific PHP version, the database, the caching into a tidy, isolated box called a container.</p><p>These boxes don’t interfere with each other. While a traditional Virtual Machine is like a whole separate house, Docker containers are more like apartments in a building. They share the main infrastructure, but each one has its own front door and furniture.</p><p>Because my dev server is technically in the cloud, it does all the heavy lifting. I can run this on any laptop, no matter how old it is, because the server handles the processing.</p><h3>Why I Built This</h3><ul><li><strong>Concurrent PHP Versions:</strong> I needed PHP 8.1, 8.2, 8.3, and 8.4 all running at the same time. Now I can switch between projects without ever restarting a service.</li><li><strong>Resource Efficiency:</strong> My old setup was a resource hog. This is highly optimised for 4GB RAM setups. Even with 5 to 10 concurrent projects, it barely breaks a sweat.</li><li><strong>No More Config Fatigue:</strong> I don’t want to remember Nginx syntax every time I start a new site. The CLI tool does it for me.</li><li><strong>VS Code Friendly:</strong> Since it lives on a single VM, the Remote-SSH experience is seamless. All my projects are in one place.</li></ul><h3>It’s Beta Time</h3><p>This is currently in beta. It’s the setup I use every single day for my own professional work, but I know there’s room to grow. I’m looking for feedback from fellow developers who are tired of the configuration tax we usually have to pay.</p><p>If you’ve been looking for a way to host multiple Laravel apps on a single dev server without the headache, I’d love for you to give it a try.</p><p><strong>Check out the repo here:</strong> <a href="https://github.com/DanJamesMills/laravel-multi-site-development">Laravel Multi-Site Development Environment</a></p><p>If it saves you even one hour of faffing with config files this week, then it’s doing its job. Drop a star on the repo if you like what you see, and please open an issue if you have ideas on how to make it even better.</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a077d888381" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>