Any idea where it stops? Is this perhaps false?
if ($this->photos) {
Use dd() to see how far it gets and check the content of your variables
Hello I have this image upload system that works perfect at my localhost but when I upload the project to live serve the image stopped uploading to the storage folder am uploading images to the storage folder and I run the storage link command at live serve here is the code am using
if ($this->photos) {
Image::where('post_id', $post->id)->delete();
$counter = 0;
foreach ($this->photos as $photo) {
$storedImage = $photo->store('public/photos');
$featured = false;
if($counter == 0 ){
$featured = true;
}
Image::create([
'url' => url('storage'. Str::substr($storedImage, 6)),
'title' => '-',
'post_id' => $post->id,
'featured' => $featured
]);
$counter++;
}
}
Please or to participate in this conversation.