Support the ongoing development of Laravel.io →
Database Laravel
Last updated 1 year ago.
0

Hey!

The easiest way to do this would be somethink like this:

// Download image - this does not handle 404 or other webserver errors
$imageContent = file_get_contents($url);

\Illuminate\Support\Facades\Storage::disk('public')->put($image, $imageContent);

You can put that code right below $image = $id.'.jpg'; in your code.

huypham55, marcelzutphen liked this reply

2
Solution selected by @renaldyks

Sign in to participate in this thread!

Eventy

Your banner here too?

Kev renaldyks Joined 19 Oct 2021

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.