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
Post a Comment