Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to store an image in laravel directly from url

use Storage;
$url = "http://www.google.co.in/intl/en_com/images/srpr/logo1w.png";
$contents = file_get_contents($url);
$name = substr($url, strrpos($url, '/') + 1);
Storage::put($name, $contents);
Source by laracasts.com #
 
PREVIOUS NEXT
Tagged: #store #image #laravel #url
ADD COMMENT
Topic
Name
7+5 =