Php 拉雷维尔。回显资产中的对象属性

Php 拉雷维尔。回显资产中的对象属性,php,html,laravel,blade,Php,Html,Laravel,Blade,如何在html资产元素中回显变量 我的元素: <img src="{{ asset("cropp/$review->user->profile_picture") }}" alt="" /> user->profile\u picture”)}}“alt=”“/> 我得到的结果是: <img src="{{ asset("cropp/{object}->profile_picture") }}" alt="" /> profile_picture”

如何在html资产元素中回显变量

我的元素:

<img src="{{ asset("cropp/$review->user->profile_picture") }}" alt="" />
user->profile\u picture”)}}“alt=”“/>
我得到的结果是:

<img src="{{ asset("cropp/{object}->profile_picture") }}" alt="" />
profile_picture”)}}“alt=”“/>
我只能使用以下格式:

<img src="{{ asset("cropp/$review->image") }}" alt="" />
image”)}}“alt=”“/>
我的img src无法取消定义我正在使用DB relationship。
提前谢谢

要在
asset()
方法中使用对象属性,可以使用以下方法:

<img src="{{ asset("cropp/" . $review->user->profile_picture) }}" alt="" />
user->profile\u picture)}“alt=”“/>
或者这个:

<img src="{{ asset("cropp/{$review->user->profile_picture}") }}" alt="" />
user->profile\u picture}}}“alt=”“/>

@evaldus要进一步理解blade的语法,请注意
{{asset(“text”)}
转换为
echo asset(“text”);