title: Unable to write in directory Laravel
body: <p>In my server, I get this error message</p>
  
  <pre><code>Unable to write in the "/home/company/blog/public/img" directory
  </code></pre>
  
  <p>When I try to upload an image like this in my controller</p>
  
  <pre><code>$file = $request-&gt;file('img');
          $name = time() . '-' . $file-&gt;getClientOriginalName();
          $file-&gt;move(public_path() .'/img/', $name);
          $company = company::where('username', $username)-&gt;first();
          $company-&gt;images()-&gt;create(['path' =&gt; "/{$name}"]);
  </code></pre>
  
  <p>I know it's about granting permissions I tried</p>
  
  <pre><code>chmod 755 /home/company/blog/public/img
  </code></pre>
  
  <p>But it still doesn't work. </p>
  
  <p>How can I resolve this?</p>