array_merge

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Merge one or more arrays
<?php array_merge(array ...$arrays): array
<?php         }



        if ($this->meta) {

            return array_merge($this->meta, ['data' => $this->data->all()]);

        }



        return $this->meta = Cache::rememberForever($this->metaCacheKey(), function () {
<?php         if ($this->exists()) {

            $dimensions = Dimensions::asset($this)->get();



            $meta = array_merge($meta, [

                'size' => $this->disk()->size($this->path()),

                'last_modified' => $this->disk()->lastModified($this->path()),

                'width' => $dimensions[0],

                'height' => $dimensions[1],

                'mime_type' => $this->disk()->mimeType($this->path()),

            ]);

        }



        return $meta;
<?php         return $keys->reduce(function ($carry, $collection) {

            foreach ($collection as $sort => $values) {

                $carry[$sort] = array_merge($carry[$sort] ?? [], $values);

            }



            return $carry;
<?php     public function data($data = null)

    {

        if (func_num_args() === 0) {

            $data = array_merge($this->model()->attributesToArray(), [

                'roles' => $this->roles()->map->handle()->values()->all(),

                'groups' => $this->groups()->map->handle()->values()->all(),

            ]);



            return collect(array_except($data, ['id', 'email']));

        }
<?php     public function mergePreferences($preferences)

    {

        $this->model()->preferences = array_merge($this->getPreferences(), Arr::wrap($preferences));

    }



    public function __set($key, $value)
<?php             return is_string($role) ? $role : $role->handle();

        })->all();



        $this->set('roles', array_merge($this->get('roles', []), $roles));



        return $this;

    }
<?php             return is_string($group) ? $group : $group->handle();

        })->all();



        $this->set('groups', array_merge($this->get('groups', []), $groups));



        return $this;

    }
<?php         parse_str(parse_url($url, PHP_URL_QUERY) ?: '', $query);



        if (static::$redirect) {

            $query = array_merge($query, ['redirect' => static::$redirect]);

        }



        return explode('?', $url)[0].'?'.http_build_query($query);
<?php     protected function getRegistrationFields()

    {

        return array_merge(

            $this->getRequiredRegistrationFields(),

            $this->getAdditionalRegistrationFields()

        );

    }
<?php     protected function getArguments()

    {

        return array_merge(parent::getArguments(), [

            ['addon', InputArgument::OPTIONAL, 'The package name of an addon (ie. john/my-addon)'],

        ]);

    }
<?php     protected function getOptions()

    {

        return array_merge(parent::getOptions(), [

            ['all',       'a', InputOption::VALUE_NONE, 'Generate everything and the kitchen sink with the addon'],

            ['action',     null, InputOption::VALUE_NONE, 'Create a new action with the addon'],

            ['fieldtype', 'f', InputOption::VALUE_NONE, 'Create a new fieldtype with the addon'],

            ['filter',     null, InputOption::VALUE_NONE, 'Create a new filter with the addon'],

            ['scope',     's', InputOption::VALUE_NONE, 'Create a new scope with the addon'],

            ['modifier',  'm', InputOption::VALUE_NONE, 'Create a new modifier with the addon'],

            ['tag',       't', InputOption::VALUE_NONE, 'Create a new tag with the addon'],

            ['widget',    'w', InputOption::VALUE_NONE, 'Create a new widget with the addon'],

        ]);

    }

}
<?php     protected function getOptions()

    {

        return array_merge(parent::getOptions(), [

            ['php', '', InputOption::VALUE_NONE, 'Create only the PHP class for the field type and skip the VueJS component'],

        ]);

    }

}
<?php     protected function getOptions()

    {

        return array_merge(parent::getOptions(), [

            ['super', '', InputOption::VALUE_NONE, 'Generate a super user with permission to do everything'],

        ]);

    }

}
<?php         $parts[] = '--update-with-dependencies';



        $parts = array_merge($parts, $extraParams);



        $this->queueComposerCommand('require', $package, ...$parts);

    }
<?php     private function runJsonComposerCommand(...$parts)

    {

        $output = $this->runComposerCommand(...array_merge($parts, ['--format=json']));




        $json = substr($output, strpos($output, "\n{"));