title: Managing Two Different environments Laravel
body: <p>Hello there i have two different environments one is production and one is dev and i am using laravel and git as version control the main issue between them is path of files so for example </p>
  
  <p>at my dev enviro i can access an image stored in /public/categories/icons/imagename 
  by doing this </p>
  
  <pre><code>  &lt;img src="{{$current_category-&gt;icon}}"&gt;
  </code></pre>
  
  <p>the icon path in my local db is this /category/icon/1592520430.png so as you can see i don't have to put public before it so laravel is going to /public/ and then it looks for my path which is /category/...</p>
  
  <p>but in my production enviro</p>
  
  <p>if i want to access an image i will do the same like this </p>
  
  <pre><code>  &lt;img src="{{$current_category-&gt;icon}}"&gt;
  </code></pre>
  
  <p>but the difference here is that this will output to /public/category/icon/1592520430.png as you can see in my dev the path is accessible without the public word but in my production i have made some changes to my controller to put the word public before the path then i can access it because it already has the public </p>
  
  <p>and this is causing some problems in git because the dev enviro is different than the production enviro so that when ever i face a problem i should go to my dev and fix it there and after knowing the problem i go to production and fix it there and then push production to master </p>
  
  <p>i have thought of some options but i don't know which one is the rightest or if there is another way to fix this problem </p>
  
  <p>1 - make my dev enviro similar to production </p>
  
  <p>2 - make production similar to dev </p>
  
  <p>but maybe both of them are wrong so please tell me how should i handle this problem and keep in mind that my project in production is exactly as mine in dev (i mean the project structure and files location)</p>