if (!empty($this->featuredImage)) {
$imageHashName = $this->featuredImage->hashName();
// Append to the validation if image is not empty
$validateData = array_merge($validateData, [
'featuredImage' => 'image'
]);
// This is to save the filename of the image in the database
$data = array_merge($data, [
'featured_image' => $imageHashName
]);
// Upload the main image
$this->featuredImage->store('public/photos');
Storage::makeDirectory('public/photos_thumb');
// Create a thumbnail of the image using Intervention Image Library
$manager = new ImageManager();
$image = $manager->make('storage/photos/' . $imageHashName)->resize(300, 200);
$image->save('storage/photos_thumb/' . $imageHashName);
a retenir :
Storage::makeDirectory('public/photos_thumb');