I have a form with a file input ready to be saved.
$request->validate([
'name'=> 'required|min:3',
'image'=> 'required|image|mimes:jpeg,png,jpg'
]);
$category = new Category();
$category->name = $request->name;
$path = $request->file('image')->store('categories_images');
$category->image = $path;
What the above code does is that it grabs the image field from the request and save it to the categories_images folder. When I first uploaded a file to test it it created the folder in storage/app.
My problem is that I want to preview the images on my site:
//store.state.serverPath returns: http://localhost:8000 -> this is right
<img :src="`${$store.state.serverPath}/storage/${category.image}`" class="image-wd"/>
When I inspect it in the nrowser it says:
http://localhost:8000/storage/categories_images/adGR57Gq6lNUqRVvEubRDfxNMZzEhya3A7oESUox.png not found
It expects the images in storage/app/public but creates the categories_images folder everytime I upload an image in storage/app. Am I missing something here?