0

I have used spatie media library package for uploading images in my laravel project . It was completely fine on localhost and it uploading and showing too . But in live server it is uploading but it is not showing . It kust show img icon and when I open it it says

Warning: require(/Applications/XAMPP/xamppfiles/htdocs/RMC/public/../../rentmerooms/vendor/autoload.php): failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/RMC/public/index.php on line 24

Fatal error: require(): Failed opening required '/Applications/XAMPP/xamppfiles/htdocs/RMC/public/../../rentmerooms/vendor/autoload.php' (include_path='.:') in /Applications/XAMPP/xamppfiles/htdocs/RMC/public/index.php on line 24

but in database it is there ..

This is how I upload picture using spatie media library package

    $room = Room::create($request->all());
    $room->addMedia($request->display_image)->toMediaCollection();
    return redirect()->to('/rooms')->with('success','Room Created 
    Successfully');

this is how I am showing the image

@foreach($room->getMedia() as $media)
 <img src="{{ asset($media->getUrl('thumb') }}" style="max-width: 100%;">
@endforeach
apokryfos
  • 38,771
  • 9
  • 70
  • 114

0 Answers0