Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Merge one or more arrays
<?php array_merge(array ...$arrays): array
<?php function trigger($name, ...$params) {
$middlewares = [];
$listeners = array_merge(
($this->listenersBefore[$name] ?? []),
($this->listeners[$name] ?? []),
($this->listenersAfter[$name] ?? []),
);
foreach ($listeners as $callback) {
$result = $callback(...$params);
<?php $fromAttributes = store($component)->get('listenersFromAttributes', []);
$listeners = array_merge($fromClass, $fromAttributes);
return static::replaceDynamicEventNamePlaceholers($listeners, $component);
}
<?php {
public static function middleware()
{
return array_map(fn ($middleware) => new Middleware($middleware), array_merge(
['web'],
(array) FileUploadConfiguration::middleware(),
));
}
public function handle()
<?php protected function headers($signedRequest, $fileType)
{
return array_merge(
$signedRequest->getHeaders(),
[
'Content-Type' => $fileType ?: 'application/octet-stream'
]
);
}
}
<?php if (is_array($value = $this->getPropertyValue($name))) {
$file = array_merge($value, [$file]);
}
}
<?php function mergeParams($toMerge)
{
$this->params = array_merge($toMerge, $this->params);
}
function normalizeViewNameAndParamsForBladeComponents()
<?php $layout->withAttributes($attributes);
$params = array_merge($params, $layout->data());
$this->view = $view;
$this->params = $params;
<?php )
);
return array_merge($rulesFromComponent, $rulesFromOutside);
}
protected function getMessages()
<?php if (method_exists($this, 'messages')) $messages = $this->messages();
elseif (property_exists($this, 'messages')) $messages = $this->messages;
$messagesFromOutside = array_merge(
...array_map(
fn($i) => value($i),
$this->messagesFromOutside
)
);
return array_merge($messages, $messagesFromOutside);
}
<?php )
);
return array_merge($messages, $messagesFromOutside);
}
protected function getValidationAttributes()
<?php if (method_exists($this, 'validationAttributes')) $validationAttributes = $this->validationAttributes();
elseif (property_exists($this, 'validationAttributes')) $validationAttributes = $this->validationAttributes;
$validationAttributesFromOutside = array_merge(
...array_map(
fn($i) => value($i),
$this->validationAttributesFromOutside
)
);
return array_merge($validationAttributes, $validationAttributesFromOutside);
}
<?php )
);
return array_merge($validationAttributes, $validationAttributesFromOutside);
}
protected function getValidationCustomValues()
<?php try {
if (filled($form->getRules())) {
$cumulativeData = array_merge($cumulativeData, $validateForm($form));
}
} catch (ValidationException $e) {
$cumulativeErrors->merge($e->validator->errors());
<?php try {
$cumulativeData = array_merge($cumulativeData, $validateSelf());
} catch (ValidationException $e) {
$e->validator->errors()->merge($cumulativeErrors);
<?php $ruleKeysForField = array_keys($rulesForField);
$data = array_merge($this->getDataForValidation($rules), $dataOverrides);
$data = $this->prepareForValidation($data);