Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
laravel/documentation/changes.md
+2
-0
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
...
...
@@ -230,6 +230,22 @@ function array_divide($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.
*
* @return bool
...
...
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