hassan / one-loop
A Laravel/PHP Package for Minimizing Collection/Array Iterations
1.0.0
2019-08-13 23:13 UTC
Requires
- php: ^7.1
- illuminate/contracts: 5.8.*
- illuminate/support: 5.8.*
Requires (Dev)
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2024-11-13 09:53:28 UTC
README
A Laravel/PHP Package for Minimizing Collection/Array Iterations
Installation
Install the package via composer:
composer require hassan/one-loop
Usage
$users = App\User::all(); $ids = one_loop($users)->reject(static function ($user) { return $user->age < 20; }) ->map(static function ($user) { return $user->id; }) ->apply();
Security
If you discover any security related issues, please email hello@hassan-ali.me instead of using the issue tracker.