Created
August 31, 2016 19:03
-
-
Save julianobailao/200b8544c161952d8ab53b95488618d2 to your computer and use it in GitHub Desktop.
Each / Map collection method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Each | |
$customer->address()->each(function ($address, $key) { | |
// do something | |
}); | |
// Map | |
$customer->address()->map(function ($address) { | |
// return something | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment