Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
68d9210e
Commit
68d9210e
authored
Apr 27, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added array_pluck method.
parent
e9bcbeac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
changes.md
laravel/documentation/changes.md
+2
-0
helpers.php
laravel/helpers.php
+16
-0
No files found.
laravel/documentation/changes.md
View file @
68d9210e
...
...
@@ -63,6 +63,8 @@
-
Added
`Input::replace`
method.
-
Added saving, saved, updating, creating, deleting, and deleted events to Eloquent.
-
Added new
`Sectionable`
interface to allow cache drivers to simulate namespacing.
-
Added support for
`HAVING`
SQL clauses.
-
Added
`array_pluck`
helper, similar to pluck method in Underscore.js.
<a
name=
"upgrade-3.2"
></a>
## Upgrading From 3.1
...
...
laravel/helpers.php
View file @
68d9210e
...
...
@@ -229,6 +229,22 @@ function array_divide($array)
return
array
(
array_keys
(
$array
),
array_values
(
$array
));
}
/**
* Pluck an array of values from an array.
*
* @param array $array
* @param string $key
* @return array
*/
function
array_pluck
(
$array
,
$key
)
{
return
array_map
(
function
(
$v
)
{
return
is_object
(
$v
)
?
$v
->
$key
:
$v
[
$key
];
},
$array
);
}
/**
* Determine if "Magic Quotes" are enabled on the server.
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment