Maryadi Poipo
Maryadi Poipo

Reputation: 1478

How to put image path in html::image() from database

I wanna put an image path in may laravel code like this

{!!Html::image({{$mdata->company_logo}},'logo',['width'=>60,'height'=>55])!!}

but {{$mdata->company_logo}} gives an error to html::image. I'm sure that image path from $mdata->company_logo has a valid data, namely the image path, because I can see it by using dd($data->company_logo).. But why html::image can't show the image...??

Thanks in advance.. :)

Upvotes: 1

Views: 71

Answers (1)

Jared Rolt
Jared Rolt

Reputation: 591

You shouldn't put the {{ }} around the $mdata->company_logo. You are already inside a php block by using {!! !!} around Html::image().

Try {!!Html::image($mdata->company_logo,'logo',['width'=>60,'height'=>55])!!}.

Upvotes: 2

Related Questions