Skip to content
Advertisement

Laravel 7 tag is not displayed

I do a udemy course

I have one problem

When I start to create a post I have to insert a photo

When I add a photo, the photo is not displayed

While the “View Source Page” clearly shows that the photo is inserted and should be displayed but not displayed

I wrote the code li

JavaScript

I tried to add this extension as well but it didn’t work again

JavaScript

View Source Page

JavaScript

PostController

JavaScript

CreatePostsRequest

JavaScript

Post.php

JavaScript

If anyone can help me for a good part of the night I fight this but I fail

Thank you in advance

Advertisement

Answer

You’re not utilising the full storage path name, as seen in your View Page Source.

First you need to make sure your storage and public folders are linked by using the artisan link command:

php artisan storage:link

Next you can specifiy the public directory with your store method:

$image = $request->image->store('public/posts');

Now you can access your image with:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement