php - Laravel - resolving uploaded image path -


my uploaded images located in storage/app/spreferenceimages

the image paths stored in db in following manner: spreferenceimages/laravel-generated-filename.ext

i trying use path in view. tried asset() helper:

<img src="{{ asset($spreference->favicon) }}">

but returns notfoundexception. generated url was:

http://localhost:3000/spreferenceimages/v2hm7njcswdxcah7rdjur4cexamqfk1xx0u4zix1.png

how can use storage folder directly (without having generate symlink in public folder)?

you can create route access file or upload file directly public folder

example using route:

route::get('image/{path}', function(){     return storage::get($path); })->name('image');  //acess image <img src="{{ route('image', $spreference->favicon) }}"> 

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -