i hope you can help me with my problem.
I have a Laravel application and i wanna optimize all my images.
I use a controller for that, but i have a lot of images, and i get execution_maxim_time_exceed.
I think, the best way to do that is to creat an artisan command.
So, i creat my with php artisan make:command Name command:example
.
After, I move my code from controller to handle() from artisan command.
I can use Storage:move($oldPath, $newPath)
, but i can't use Image:make($filePath).
My file storage is "storage/app/images/image.png
" and filePath is 'images/image.png
'
When i use the controller, the method isFilePath()
from Intervention\Image\AbstractDecoder
return true, but in artisan command return false.
Method isFilePath()
call the function is_file()
public function isFilePath()
{
if (is_string($this->data)) {
try {
return is_file($this->data);
} catch (\Exception $e) {
return false;
}
}
return false;
}
Why i get false from the function is_file() with the same path for file in artisan command, and in controller i get true? (for the same path).
Thanks