Laravel 8 concat() {#collection-method}
2021-07-19 09:33 更新
concat
方法在集合的末端附加指定的 数组
或集合值:
$collection = collect(['John Doe']);
$concatenated = $collection->concat(['Jane Doe'])->concat(['name' => 'Johnny Doe']);
$concatenated->all();
// ['John Doe', 'Jane Doe', 'Johnny Doe']
以上内容是否对您有帮助:
更多建议: