array_merge_recursive

Supported Versions: PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8
Merge one or more arrays recursively
array_merge_recursive(array ...$arrays): array
    public function mergeRecursive($items)

    {

        return new static(
array_merge_recursive($this->items$this->getArrayableItems($items)));

    }
    public function mergeBindings(self $query)

    {

        
$this->bindings array_merge_recursive($this->bindings$query->bindings);



        return 
$this;

    }
        $events = [];



        foreach (
$this->laravel->getProviders(EventServiceProvider::class) as $provider) {

            
$providerEvents array_merge_recursive($provider->shouldDiscoverEvents() ? $provider->discoverEvents() : [], $provider->listens());



            
$events[get_class($provider)] = $providerEvents;

        }
            return $cache[get_class($this)] ?? [];

        } else {

            return 
array_merge_recursive(

                
$this->discoveredEvents(),

                
$this->listens()

            );

        }

    }
                        return ! is_dir($directory);

                    })

                    ->
reduce(function ($discovered$directory) {

                        return 
array_merge_recursive(

                            
$discovered,

                            
DiscoverEvents::within($directory$this->eventDiscoveryBasePath())

                        );

                    }, []);

    }
    public function withHeaders(array $headers)

    {

        return 
tap($this, function () use ($headers) {

            
$this->options array_merge_recursive($this->options, [

                
'headers' => $headers,

            ]);

        });

    }
    public function withCookies(array $cookiesstring $domain)

    {

        return 
tap($this, function () use ($cookies$domain) {

            
$this->options array_merge_recursive($this->options, [

                
'cookies' => CookieJar::fromArray($cookies$domain),

            ]);

        });

    }
    {

        return 
tap($this, function () use ($options) {

            
$this->options array_replace_recursive(

                
array_merge_recursive($this->optionsArr::only($options$this->mergableOptions)),

                
$options

            
);

        });
    public function mergeOptions(...$options)

    {

        return 
array_replace_recursive(

            
array_merge_recursive($this->optionsArr::only($options$this->mergableOptions)),

            ...
$options

        
);

    }
        return tap(response()->json(

            
$this->wrap(

                
$this->resource->resolve($request),

                
array_merge_recursive(

                    
$this->paginationInformation($request),

                    
$this->resource->with($request),

                    
$this->resource->additional

                
)

            ),

            
$this->calculateStatus(),

            [],
            $data = [($this->wrapper() ?? 'data') => $data];

        }



        return 
array_merge_recursive($data$with$additional);

    }
            'where' => static::formatWhere($new$old),

        ]);



        return 
array_merge_recursive(Arr::except(

            
$old, ['namespace''prefix''where''as']

        ), 
$new);

    }
            $messages $messages->getMessageBag()->getMessages();

        }



        
$this->messages array_merge_recursive($this->messages$messages);



        return 
$this;

    }
                    if ($rule instanceof NestedRules) {

                        
$compiled $rule->compile($key$value$data);



                        
$this->implicitAttributes array_merge_recursive(

                            
$compiled->implicitAttributes,

                            
$this->implicitAttributes,

                            [
$attribute => [$key]]

                        );



                        
$results $this->mergeRules($results$compiled->rules);

                    } else {
        $response = (new ValidationRuleParser($this->data))

                            ->
explode(ValidationRuleParser::filterConditionalRules($rules$this->data));



        
$this->rules array_merge_recursive(

            
$this->rules$response->rules

        
);



        
$this->implicitAttributes array_merge(

            
$this->implicitAttributes$response->implicitAttributes