How to fix this laravel error?
NotReadableException in AbstractDecoder.php line 80: Unable to init from given url (https://example.net/img/picture.png?1549836294)
Here is my code: AbstractDecoder.php
public function initFromUrl($url)
{
$options = array(
'http' => array(
'method'=>"GET",
'header'=>"Accept-language: en
".
"User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.2 (KHTML, like Gecko) Chrome/22.0.1216.0 Safari/537.2
"
)
);
$context = stream_context_create($options);
if ($data = @file_get_contents($url, false, $context)) {
return $this->initFromBinary($data);
}
throw new \Intervention\Image\Exception\NotReadableException(
"Unable to init from given url (".$url.")."
);
}
https://example.net/img/picture.png?1549836294
is not an image.
You need to replace the url in the example code you copied with a url that does return an image.