title: Laravel: create an upload directory on the fly
body: <p>I have got this, </p>
  
  <pre><code>$destinationPath = public_path(). '/img/'. $username;
  </code></pre>
  
  <p>which I thought would create the directory alright, but it came up with a </p>
  
  <pre><code>Symfony \ Component \ HttpFoundation \ File \ Exception \ FileException
  
  Unable to create the "/img/alvarito" directory
  </code></pre>
  
  <p>Any idea what is wrong? seems to me that it is trying to create also the /img/, which already exists, what I naturally want is that inside that 'img' directory creates me subdirectories for each user as they upload their files.</p>
  
  <p>thanks a lot</p>
  
  <p>A</p>