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
function chunk(array, size) { | |
return array.reduce(function (res, item, index) { | |
if (index % size === 0) { | |
res.push([]); | |
} | |
res[res.length - 1].push(item); | |
return res; | |
}, []); | |
} |
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
trait HasEnums | |
{ | |
/** | |
* The array of enumerators of a given group. | |
* | |
* @param null|string $group | |
* @return array | |
*/ | |
static function enums($group = null) | |
{ |