<?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: Codegenie</title>
    <description>The latest articles on DEV Community by Codegenie (@codegenie_be).</description>
    <link>https://dev.to/codegenie_be</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3339251%2Fb19846c4-460c-439d-b7bb-9dfe07fc4d3e.png</url>
      <title>DEV Community: Codegenie</title>
      <link>https://dev.to/codegenie_be</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codegenie_be"/>
    <language>en</language>
    <item>
      <title>Laravel .env changes not reflected after deployment: causes and a safe shared-hosting fallback</title>
      <dc:creator>Codegenie</dc:creator>
      <pubDate>Tue, 11 Aug 2026 19:28:32 +0000</pubDate>
      <link>https://dev.to/codegenie_be/laravel-env-changes-not-reflected-after-deployment-causes-and-a-safe-shared-hosting-fallback-5ec0</link>
      <guid>https://dev.to/codegenie_be/laravel-env-changes-not-reflected-after-deployment-causes-and-a-safe-shared-hosting-fallback-5ec0</guid>
      <description>&lt;p&gt;Changing a production &lt;code&gt;.env&lt;/code&gt; file and still seeing the old database host, mail settings, application URL, or feature flag is a familiar Laravel deployment surprise.&lt;/p&gt;

&lt;p&gt;Usually, Laravel is doing exactly what it was told to do: use a cached configuration snapshot.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Disclosure: Codegenie maintains the open-source package discussed near the end of this article. The normal Laravel deployment commands remain the preferred solution.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why the new value is ignored
&lt;/h2&gt;

&lt;p&gt;Laravel's configuration files read environment variables and expose them through the configuration repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// config/services.php&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'example'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s1"&gt;'endpoint'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;env&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'EXAMPLE_ENDPOINT'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Application code should then read the configuration value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$endpoint&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'services.example.endpoint'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan config:cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Laravel combines the configuration into a cached snapshot. Once that snapshot exists, the framework does not load the application's &lt;code&gt;.env&lt;/code&gt; file during requests or Artisan commands. That is why editing &lt;code&gt;.env&lt;/code&gt; alone does not change the value your application sees.&lt;/p&gt;

&lt;p&gt;Laravel also recommends calling &lt;code&gt;env()&lt;/code&gt; only from configuration files. Calling &lt;code&gt;env()&lt;/code&gt; directly from controllers, jobs, or services can return &lt;code&gt;null&lt;/code&gt; after configuration has been cached.&lt;/p&gt;

&lt;p&gt;The official explanation is in Laravel's &lt;a href="https://laravel.com/docs/13.x/configuration#configuration-caching" rel="noopener noreferrer"&gt;configuration caching documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The normal production fix
&lt;/h2&gt;

&lt;p&gt;A reliable deployment should rebuild the cache after the new code and environment configuration are in place:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--no-dev&lt;/span&gt; &lt;span class="nt"&gt;--optimize-autoloader&lt;/span&gt;
php artisan config:cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the application uses route caching, rebuild that too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan route:cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you intentionally do not want cached configuration, clear it instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan config:clear
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important part is that the cache command belongs to the deployment process. Run it on every release, after all relevant files and environment settings have been updated.&lt;/p&gt;

&lt;p&gt;For deployments with release directories, build caches inside the new release before switching the live symlink. That avoids serving a half-updated application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why FTP and shared hosting make this harder
&lt;/h2&gt;

&lt;p&gt;The ideal flow assumes you can execute PHP CLI commands during deployment.&lt;/p&gt;

&lt;p&gt;On shared hosting that assumption may be false:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the site is uploaded through FTP;&lt;/li&gt;
&lt;li&gt;cPanel or Plesk provides no useful deploy hook;&lt;/li&gt;
&lt;li&gt;SSH is unavailable;&lt;/li&gt;
&lt;li&gt;PHP functions such as &lt;code&gt;exec()&lt;/code&gt; are disabled;&lt;/li&gt;
&lt;li&gt;the old cache file survives while &lt;code&gt;.env&lt;/code&gt; or &lt;code&gt;config/*.php&lt;/code&gt; changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Clearing a browser cache or application data cache does not solve this. Configuration cache and route cache are deployment artifacts, not regular response or database cache.&lt;/p&gt;

&lt;p&gt;A web request could notice the problem, but timing matters. Laravel reads cached configuration while the application is bootstrapping. Middleware and normal service providers run too late to prevent that request from loading stale configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a safe fallback needs to do
&lt;/h2&gt;

&lt;p&gt;A useful fallback should protect correctness without pretending to replace a deployment pipeline.&lt;/p&gt;

&lt;p&gt;It should:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;run before Laravel consumes cached configuration or routes;&lt;/li&gt;
&lt;li&gt;detect relevant source changes without reading or storing secret values;&lt;/li&gt;
&lt;li&gt;stop stale cache from being used immediately;&lt;/li&gt;
&lt;li&gt;rebuild through PHP CLI when that is available;&lt;/li&gt;
&lt;li&gt;degrade safely when shell execution is unavailable;&lt;/li&gt;
&lt;li&gt;use locks and exact source signatures to avoid racing repairs;&lt;/li&gt;
&lt;li&gt;avoid enabling cache types the application was not already using.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That design is the basis of &lt;a href="https://codegenie-be.github.io/laravel-config-cache-guard/" rel="noopener noreferrer"&gt;Laravel Config Cache Guard&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the fallback works
&lt;/h2&gt;

&lt;p&gt;Install it with one Composer command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require codegenie-be/laravel-config-cache-guard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Composer loads the guard before &lt;code&gt;bootstrap/app.php&lt;/code&gt;. It compares metadata for relevant sources such as &lt;code&gt;.env&lt;/code&gt;, configuration files, route files, and route bootstrap files. It tracks timestamps, sizes, and filesystem metadata—not environment values.&lt;/p&gt;

&lt;p&gt;When the sources are unchanged, the request continues normally.&lt;/p&gt;

&lt;p&gt;When an existing config cache is stale, the guard prevents Laravel from using it. When an existing route cache is stale, the guard bypasses it using a signature-based cache path.&lt;/p&gt;

&lt;p&gt;If PHP CLI execution is available, it can rebuild before Laravel boots.&lt;/p&gt;

&lt;p&gt;If &lt;code&gt;exec()&lt;/code&gt; is disabled, the current request continues without the known-stale deployment cache. The guard writes an internal pending marker, and the package service provider rebuilds through Laravel's own &lt;code&gt;Artisan::call()&lt;/code&gt; after the response. A following request can then use the refreshed cache.&lt;/p&gt;

&lt;p&gt;There is no public repair endpoint, no repair token, and no telemetry.&lt;/p&gt;

&lt;h2&gt;
  
  
  Defaults that avoid surprising applications
&lt;/h2&gt;

&lt;p&gt;The package does &lt;strong&gt;not&lt;/strong&gt; automatically turn on config caching for every project.&lt;/p&gt;

&lt;p&gt;If no config cache exists, config-cache creation remains disabled unless you explicitly opt in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CONFIG_CACHE_GUARD_CREATE_CONFIG_CACHE=true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Route guarding starts only when the application already has route cache.&lt;/p&gt;

&lt;p&gt;This matters because a correctness guard should not silently change an application's caching policy.&lt;/p&gt;

&lt;p&gt;You can optionally inspect the integration with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan config-cache-guard:status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That status command is verification, not a second installation step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;p&gt;This fallback still needs a writable Laravel bootstrap cache directory.&lt;/p&gt;

&lt;p&gt;Without &lt;code&gt;exec()&lt;/code&gt;, repair happens after the current response. The first request runs without stale deployment cache, but it may be uncached. The next request uses the rebuilt cache if repair succeeded.&lt;/p&gt;

&lt;p&gt;Custom bootstrap paths selected later in application code cannot always be discovered before Laravel boots.&lt;/p&gt;

&lt;p&gt;And most importantly: if your platform supports reliable deployment hooks, keep using the standard Laravel cache commands. The package is a safety net for restricted hosting, not a replacement for a healthy deployment process and not a promise to make every website faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compatibility and testing
&lt;/h2&gt;

&lt;p&gt;The current release supports Laravel 12 and 13 on non-EOL PHP versions. Its test suite installs fresh Laravel applications and verifies real HTTP requests, including Linux and Windows scenarios and the &lt;code&gt;exec()&lt;/code&gt;-disabled repair path.&lt;/p&gt;

&lt;p&gt;The source, demo, security notes, and deployment recipes are available on &lt;a href="https://github.com/Codegenie-BE/laravel-config-cache-guard" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you deploy Laravel through FTP, cPanel, Plesk, or another restricted host, technical feedback is especially welcome. Which deployment limitations have you encountered, and how do you currently prevent stale configuration from reaching users?&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
    <item>
      <title>I Built an Open Source Multi-Step Form Wizard for Livewire 3 — Here's Why (and How You Can Use It)</title>
      <dc:creator>Codegenie</dc:creator>
      <pubDate>Wed, 09 Jul 2025 14:40:30 +0000</pubDate>
      <link>https://dev.to/codegenie_be/i-built-an-open-source-multi-step-form-wizard-for-livewire-3-heres-why-and-how-you-can-use-it-n01</link>
      <guid>https://dev.to/codegenie_be/i-built-an-open-source-multi-step-form-wizard-for-livewire-3-heres-why-and-how-you-can-use-it-n01</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;⏳ Stop wasting time rebuilding the same multi-step logic in every project.&lt;br&gt;&lt;br&gt;
This Livewire 3 wizard does the job — fast, clean, and fully themeable.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  A Clean, Customizable Livewire Multi-Step Wizard — Open Source &amp;amp; Ready to Use 🧞
&lt;/h1&gt;

&lt;p&gt;As a Laravel developer, I often find myself building onboarding flows, registration forms, or multi-step wizards. With Livewire 3, the reactive experience is awesome — but structuring multi-step logic properly still takes some time.&lt;/p&gt;

&lt;p&gt;That’s why I decided to open-source my own &lt;strong&gt;Livewire 3.x Multi-Step Form Wizard&lt;/strong&gt;, designed to be:&lt;/p&gt;

&lt;p&gt;✅ Lightweight&lt;br&gt;&lt;br&gt;
✅ Real-time validated&lt;br&gt;&lt;br&gt;
✅ Pest-tested&lt;br&gt;&lt;br&gt;
✅ Easy to theme via Tailwind CSS&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 Try it yourself
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;🌐 Live Demo:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://laravel-livewire.codegenie.be" rel="noopener noreferrer"&gt;https://laravel-livewire.codegenie.be&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;⭐ GitHub Repo:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://github.com/Codegenie-BE/laravel-livewire-multistep-form" rel="noopener noreferrer"&gt;https://github.com/Codegenie-BE/laravel-livewire-multistep-form&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🧱 Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Built with Laravel 12, Livewire 3.6, and TailwindCSS&lt;/li&gt;
&lt;li&gt;Supports multi-step navigation with progress indicators&lt;/li&gt;
&lt;li&gt;Validation per step (&lt;code&gt;$rules&lt;/code&gt; &amp;amp; Livewire lifecycle)&lt;/li&gt;
&lt;li&gt;Clean layout with &lt;code&gt;app.blade.php&lt;/code&gt; &amp;amp; &lt;code&gt;thankyou.blade.php&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Configurable color via &lt;code&gt;config/ui.php&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Feature test included using Pest!&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Why I built it
&lt;/h2&gt;

&lt;p&gt;Every time I had to make a multi-step form, I rewrote the same logic. Most packages were either outdated, too bloated, or not Livewire 3-ready.&lt;br&gt;&lt;br&gt;
So I made one that just works — and feels native to Laravel.&lt;/p&gt;

&lt;p&gt;My goal?&lt;br&gt;&lt;br&gt;
To save other developers &lt;strong&gt;hours&lt;/strong&gt; on form flow logic and keep their codebase clean.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠 How to use it
&lt;/h2&gt;

&lt;p&gt;Clone the repo, install dependencies, migrate the DB and run the local server:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
bash
git clone https://github.com/Codegenie-BE/laravel-livewire-multistep-form.git
composer install
npm install &amp;amp;&amp;amp; npm run build
php artisan migrate
php artisan serve

---

💬 Do you use multi-step forms in your projects?  
Have feedback or ideas to improve this component?

Let me know in the comments — I'd love to hear how *you* would extend it.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>laravel</category>
      <category>livewire</category>
      <category>opensource</category>
      <category>tailwindcss</category>
    </item>
  </channel>
</rss>
