我正试着在我的刀片邮件模板中放置一个指向我的web应用程序的链接,但是url是这样显示的:http://127.0.0.1:8000/.$code->折扣->url。而不是正确构建的、有效的url。
我是这样做的:
<a href="{{ url('.$code->discount->url.') }}">Enlace</a>我还尝试了:
<a href="{{ $code->discount->url }}">Enlace</a>Second way只给了我部分url (见下文),而不是完整的url主机和路径)。
$code->折扣->url为/promociones/hamburguesa-de-queso
发布于 2019-04-30 19:45:59
只需从$code->discount->url周围删除'. .'即可
<a href="{{ url($code->discount->url) }}">Enlace</a>PHP helper是php函数,所以用引号将$code->discount->url括起来会使php将其视为文字字符串。
https://stackoverflow.com/questions/55920200
复制相似问题