php - 将
标签添加到php
问题描述
我想通过 Laravel 发送通知,一切正常,但我有一些风格问题,
如何将
<br>
标签添加到这一行php
?
public function toTelegram($product)
{
return TelegramMessage::create()
->to('@xxxxx')
->content('New Product is here ' .$product->title) //need br here
->button('Shop Now', 'http://domain.co/store/'. $product->slug);
}
当用户收到通知时,我想$product->title
在新行中显示。
PS:我试过了\n
,\r\n
但<br>
没有任何改变。
这是现在的样子:
解决方案
我认为您应该将这一行更改为此
->content('New Product is here ' .$product->title) //need br here
,->content('New Product is here '.'<br>'.$product->title)
尝试将 < br> 替换为 \n ...
推荐阅读
- python - Pandas 在 Visual Studio Code 中不起作用
- swift - 在缩放按钮时保持按钮距离彼此成比例
- python - 在按日期嵌套的列表中按时间分组元素?
- javascript - 将字符串点表示法转换为 javascript 对象
- android - NoClassDefFoundError:解析失败:Lkotlinx/coroutines/Dispatchers
- windows - 带有“本机 Windows 安全通道库”的 Cygwin git
- java - 无法使用 Java 从 mongo 获取数据
- file-io - 将富文本文档作为嵌入资源加载时 UWP 挂起
- java - 为什么即使在 moveToNext() 之类的调用之后,android SQLite 光标仍位于位置 -1?
- php - Swiftmailer 和一次选择多个附件(Windows 资源管理器)