package and depencies

This commit is contained in:
RafficMohammed
2023-01-08 02:57:24 +05:30
parent d5332eb421
commit 1d54b8bc7f
4309 changed files with 193331 additions and 172289 deletions

View File

@@ -7,10 +7,13 @@ if (! function_exists('collect')) {
/**
* Create a collection from the given value.
*
* @param mixed $value
* @return \Illuminate\Support\Collection
* @template TKey of array-key
* @template TValue
*
* @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue>|null $value
* @return \Illuminate\Support\Collection<TKey, TValue>
*/
function collect($value = null)
function collect($value = [])
{
return new Collection($value);
}
@@ -58,7 +61,7 @@ if (! function_exists('data_get')) {
if ($segment === '*') {
if ($target instanceof Collection) {
$target = $target->all();
} elseif (! is_array($target)) {
} elseif (! is_iterable($target)) {
return value($default);
}
@@ -177,6 +180,7 @@ if (! function_exists('value')) {
* Return the default value of the given value.
*
* @param mixed $value
* @param mixed $args
* @return mixed
*/
function value($value, ...$args)