Answers for "laravel collection tap"

PHP
0

laravel collection tap

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

// 1
Posted by: Guest on July-24-2021

Browse Popular Code Answers by Language