Get image name from database in laravel -


i have database, columns image , alttag. want use them in laravel blade view. try this:

{{ html::image('images/{{ $item->image }}', $alt="{{ $item->alttag }}") }} 

but syntax isn't correct. if echo image , alttag this:

<h1>{{ $item->alttag }}</h1> 

then correct. wonder wrong in code.

you used blade syntax in php string. watch compiled blade templates see did go wrong.

in short. try this:

{{ html::image('images/'. $item->image, $alt = $item->alttag) }} 

or equally short:

{{ html::image("images/{$item->image}", $alt = $item->alttag) }} 

Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -