1

I have multiple disks set up within config/filesystems.php like so: I have recently added 'mealimages'.

    'menus' => [
        'driver' => 'local',
        'root' => storage_path('app/menus'),
        'url' => env('APP_URL').'/menu-store',
        'visibility' => 'private',
    ],

    'mealimages' => [
        'driver' => 'local',
        'root' => storage_path('app/meal-images'),
        'url' => env('APP_URL').'/meal-images-store',
        'visibility' => 'public',
    ],

I'm using laravel media library to handle my image uploads, in my model, I have configured the collection to use the mealimages disk like:

$this->addMediaCollection('meal-image')->useDisk('mealimages')->singleFile();

I have flushed application cache by running php artisan optimize:clear, tried deleting my /public/storage directory and re-ran php artisan storage:link to try and get the images to show once they have been uploaded. I can confirm that the images are being stored correctly within my storage directly but the URL generated by laravel media library for the image returns 404.

I have also tried updating the visibility but no luck.

I am able to get the functionality and image uploads working correctly and showing if I update the ->useDisk() on the model to use the 'menus' disk.

 $this->addMediaCollection('meal-image')->useDisk('menus')->singleFile();

I'm struggling to figure out why its working for the menus disk but not my mealimages disk? What I am missing in order to set up a new filesystem to use?

Any help would be great? Thanks

lky
  • 1,081
  • 3
  • 15
  • 31

0 Answers0