Skip to content

A Laravel/PHP Package for Minimizing Collection/Array Iterations

License

Notifications You must be signed in to change notification settings

dhassanali/one-loop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

One Loop

Latest Version on Packagist Build Status License Coverage Status

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 [email protected] instead of using the issue tracker.