<?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: Mohamed</title>
    <description>The latest articles on DEV Community by Mohamed (@m7mdsa3ed_).</description>
    <link>https://dev.to/m7mdsa3ed_</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%2F470637%2Fabd16b63-e6eb-41a0-a1d0-ff7509d69bb5.png</url>
      <title>DEV Community: Mohamed</title>
      <link>https://dev.to/m7mdsa3ed_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/m7mdsa3ed_"/>
    <language>en</language>
    <item>
      <title>Laravel: Is it okay to change the config in runtime?!</title>
      <dc:creator>Mohamed</dc:creator>
      <pubDate>Sun, 07 Nov 2021 10:43:19 +0000</pubDate>
      <link>https://dev.to/m7mdsa3ed_/laravel-is-it-okay-to-change-the-config-in-runtime-3bmk</link>
      <guid>https://dev.to/m7mdsa3ed_/laravel-is-it-okay-to-change-the-config-in-runtime-3bmk</guid>
      <description>&lt;p&gt;I was working on implementing settings for emails, taxes, SMS providers so the client can change the credentials by themselves and switch between some providers. &lt;/p&gt;

&lt;p&gt;That credentials and active providers are stored in the database, and I get 'em in the AppServiceProvider and overrider the config with 'em&lt;/p&gt;

&lt;p&gt;But I had an issue with Queue Jobs&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Since queue workers are long-lived processes, they will not notice changes to your code without being restarted&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So I was in front of 2 solutions &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Restart the worker after updating DB &lt;/li&gt;
&lt;li&gt;Change how some integrated services like "Mail" get the config and replace 'em from database&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I choose the 2nd solution since it's challenging 🙂&lt;/p&gt;

&lt;h2&gt;
  
  
  But it okay to do so "Change the config in runtime"? I just dunno, maybe I'll have some issue like this in the future.
&lt;/h2&gt;

</description>
      <category>laravel</category>
    </item>
  </channel>
</rss>
