Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 1022 Bytes

README.md

File metadata and controls

34 lines (24 loc) · 1022 Bytes

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.