title: Saving photos from link to storage with Laravel 5.4
body: <p>Sorry for newbie question, I used PHP <code>curl</code> to store photos in public folder from an external source in my Laravel project. Now I want to store them in storage but I have a hard time to figure it out.</p>
  
  <p>So the question is: How to store photos in storage using <code>curl</code>?</p>
  
  <p>This is my code:
  //Download photos</p>
  
  <pre><code>        mkdir('photos/' . $car-&gt;car_id);
  
          $num = 0;
  
          foreach (explode('#', $car-&gt;pics_urls) as $url)
          {
              $curlCh = curl_init();
              curl_setopt($curlCh, CURLOPT_URL, $url);
              curl_setopt($curlCh, CURLOPT_RETURNTRANSFER, 1);
              curl_setopt($curlCh, CURLOPT_SSLVERSION,3);
              $curlData = curl_exec ($curlCh);
              curl_close ($curlCh);
  
              $downloadPath = 'photos/' . $car-&gt;car_id . '/' . ++$num . '.jpg' ;
              $file = fopen($downloadPath, "w+");
              fputs($file, $curlData);
              fclose($file);
  
          }
  </code></pre>