Skip to content

Commit 74584d0

Browse files
committed
Merge pull request #7166 from JosephSilber/collect-helper
[5.0] Move collect helper from foundation to support
2 parents 41faab2 + b3170dc commit 74584d0

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

src/Illuminate/Foundation/helpers.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -126,20 +126,6 @@ function bcrypt($value, $options = array())
126126
}
127127
}
128128

129-
if ( ! function_exists('collect'))
130-
{
131-
/**
132-
* Create a collection from the given value.
133-
*
134-
* @param mixed $value
135-
* @return \Illuminate\Support\Collection
136-
*/
137-
function collect($value)
138-
{
139-
return Illuminate\Support\Collection::make($value);
140-
}
141-
}
142-
143129
if ( ! function_exists('config'))
144130
{
145131
/**

src/Illuminate/Support/helpers.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use Illuminate\Support\Arr;
44
use Illuminate\Support\Str;
5+
use Illuminate\Support\Collection;
56
use Illuminate\Support\Debug\Dumper;
67

78
if ( ! function_exists('append_config'))
@@ -358,6 +359,20 @@ function class_uses_recursive($class)
358359
}
359360
}
360361

362+
if ( ! function_exists('collect'))
363+
{
364+
/**
365+
* Create a collection from the given value.
366+
*
367+
* @param mixed $value
368+
* @return \Illuminate\Support\Collection
369+
*/
370+
function collect($value = null)
371+
{
372+
return new Collection($value);
373+
}
374+
}
375+
361376
if ( ! function_exists('data_get'))
362377
{
363378
/**

0 commit comments

Comments
 (0)