I've tried displaying an image with laravel using a Query-- The images are stored in the storage directory and a symlink with "public" has already been established.
I have tried using:
src="{{storage_path('app/public/'.$post->post_image)}}"
src="{{ asset('storage/'.$post->post_image) }}"
src="{{$post->post_image}}"
Testing, I discovered I could use a static path in order to succesfully display the imaage like so:
src="{{ asset('storage/images/image_name.jpeg')}}"
However, this is not what I'm looking for.
The query {{$post->post_image}}
returns the following:
127.0.0.1:8000/images/image_name.jpeg
EDIT: If I go edit the database and add "storage/" before the url of the image, then I can use src="{{asset($post->post_image)}}"
to display it.
As mentioned before, I already tried src="{{asset('storage/' . $post->post_image)}}
without altering the database.
str_replace()
orpreg_replace()
to change127.0.0.1:8000
intostorage
. - jstarnatepost_image
look like in the database? - thefabdev127.0.0.1:8000
should have access to your public folder. - jstarnate