Last active
May 5, 2020 09:31
-
-
Save banqhsia/99554bf594686cdf9c220318df8eb585 to your computer and use it in GitHub Desktop.
Macros the absents method to illuminate Arr class.
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 | |
/** | |
* Check if an item or items NOT exist. | |
* | |
* @param \ArrayAccess|array $array | |
* @param string|array $keys | |
* @return bool | |
*/ | |
Arr::macro('absents', function ($array, $keys) { | |
return ! static::has($array, $keys); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment