I need to get photo from given url and upload it to my local storage and manipulate it with laravel stapler. Any ideas how can I do this?
Managed to solve it by giving photo path as string.
If anyone is interested how it looks like
$url = 'http://url.to/picture';
$path = 'uploads/pictures';
$name = md5(str_random(10)) . '.jpg';
$filePath = public_path($path . '/' . $name);
$file = fopen($filePath, 'w');
$options = [
CURLOPT_FILE => $file,
CURLOPT_TIMEOUT => 60,
CURLOPT_URL => $url,
];
$ch = curl_init();
curl_setopt_array($ch, $options);
curl_exec($ch);
curl_close($ch);
fclose($file);
Picture::create(['image' => $filePath]);