📜  laravel collection tap - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:19.942000             🧑  作者: Mango

代码示例1
collect([2, 4, 3, 1, 5])
    ->sort()
    ->tap(function ($collection) {
        Log::debug('Values after sorting', $collection->values()->toArray());
    })
    ->shift();

// 1