The collect function creates a collection instance from the given value:
$collection collect(['taylor''abigail']);
    public function check($abilities$arguments = [])

    {

        return 
collect($abilities)->every(

            fn (
$ability) => $this->inspect($ability$arguments)->allowed()

        );

    }
    public function any($abilities$arguments = [])

    {

        return 
collect($abilities)->contains(fn ($ability) => $this->check($ability$arguments));

    }
            return [];

        }



        return 
collect($models)->map(function ($model) use ($request) {

            return 
$model instanceof Model $model $this->getModel($request$model);

        })->
all();

    }
    {

        
$callbackParameters $this->extractParameters($callback);



        return 
collect($this->extractChannelKeys($pattern$channel))->reject(function ($value$key) {

            return 
is_numeric($key);

        })->
map(function ($value$key) use ($callbackParameters) {

            return 
$this->resolveBinding($key$value$callbackParameters);
    protected function prepareBatchedChain(array $chain)

    {

        return 
collect($chain)->map(function ($job) {

            
$job $job instanceof Closure CallQueuedClosure::create($job) : $job;



            return 
$job->withBatchId($this->id);
        if ($counts->pendingJobs === && $this->hasThenCallbacks()) {

            
$batch $this->fresh();



            
collect($this->options['then'])->each(function ($handler) use ($batch) {

                
$this->invokeHandlerCallback($handler$batch);

            });

        }
        if ($counts->allJobsHaveRanExactlyOnce() && $this->hasFinallyCallbacks()) {

            
$batch $this->fresh();



            
collect($this->options['finally'])->each(function ($handler) use ($batch) {

                
$this->invokeHandlerCallback($handler$batch);

            });

        }
        if ($counts->failedJobs === && $this->hasCatchCallbacks()) {

            
$batch $this->fresh();



            
collect($this->options['catch'])->each(function ($handler) use ($batch$e) {

                
$this->invokeHandlerCallback($handler$batch$e);

            });

        }
        if ($counts->allJobsHaveRanExactlyOnce() && $this->hasFinallyCallbacks()) {

            
$batch $this->fresh();



            
collect($this->options['finally'])->each(function ($handler) use ($batch$e) {

                
$this->invokeHandlerCallback($handler$batch$e);

            });

        }
    public function chain($chain)

    {

        
$this->chained collect($chain)->map(function ($job) {

            return 
$this->serializeJob($job);

        })->
all();
    public function invokeChainCatchCallbacks($e)

    {

        
collect($this->chainCatchCallbacks)->each(function ($callback) use ($e) {

            
$callback($e);

        });

    }
            'RequestItems' => [

                
$this->table => [

                    
'ConsistentRead' => false,

                    
'Keys' => collect($prefixedKeys)->map(function ($key) {

                        return [

                            
$this->keyAttribute => [

                                
'S' => $key,
        $now Carbon::now();



        return 
array_merge(collect(array_flip($keys))->map(function () {


        })->
all(), collect($response['Responses'][$this->table])->mapWithKeys(function ($response) use ($now) {

            if (
$this->isExpired($response$now)) {
        return array_merge(collect(array_flip($keys))->map(function () {


        })->
all(), collect($response['Responses'][$this->table])->mapWithKeys(function ($response) use ($now) {

            if (
$this->isExpired($response$now)) {

                
$value null;

            } else {
        $this->dynamo->batchWriteItem([

            
'RequestItems' => [

                
$this->table => collect($values)->map(function ($value$key) use ($expiration) {

                    return [

                        
'PutRequest' => [

                            
'Item' => [