Created
August 23, 2019 15:23
-
-
Save banqhsia/040846c954138e149489f49af1ed63e1 to your computer and use it in GitHub Desktop.
Macros the diff method in case insensitive.
This file contains hidden or 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 | |
/** | |
* Diff the collection with the given items (case insensitive). | |
* | |
* @see Collection::diffUsing() | |
*/ | |
Collection::macro('diffCi', function ($diffBy) { | |
return $this->diffUsing($diffBy, 'strcasecmp'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment