I wanted to save a file from External Url which would have any kind of file like say "jpg, png, mp4 etc"
I want to save it in the public directory of Laravel App. How could I do that? Any help will be highly appreciated.
I tried the following thing, but it's saving file in my storage folder:
Storage::put($name, $contents);
Thanks
create an img folder in public path and :
$image = file_get_contents("https://logos-download.com/wp-content/uploads/2016/09/Laravel_logo.png");
file_put_contents(public_path('img/a.png'), $image);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With