It's been a while since I open my Laravel directory and I found there are many images in storage/app folder (probably copied from the public directory) but I don't remember ever putting uploaded images there. did Laravel put them there automatically? How do I turn it off? It causes my disk to be full.
Here's my upload script...
<?php
protected function uploadPhoto($photo, $photoName)
{
$attachment = $photo;
$photoName = $photoName.'.jpg';
$storePhoto = ($attachment) ? $attachment->storeAs('gallery', $photoName) : null;
if ($storePhoto) {
$path = public_path('images/' . $storePhoto);
$path_thumb = public_path('images/' . str_replace('gallery', 'gallery/thumbnails/', $storePhoto));
$img = Image::make($attachment->getRealPath());
$img->resize(1024, null, function ($constraint) {
$constraint->aspectRatio();
});
if ($img->save($path, 85)) {
Image::make($path)->resize(300, null, function ($constraint) {
$constraint->aspectRatio();
})->Save($path_thumb, 60);
}
}
}