Skip to content

nunomaduro/laravel-any

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Any example

Build Status Total Downloads Latest Version License

About laravel-any

laravel-any was created by, and is maintained by Nuno Maduro, and is an Laravel collection macro that determine if any item from the collection passes the given truth test.

Installation & Usage

Requires PHP 7.2+

Create your package using Composer:

composer require nunomaduro/laravel-any

How to use:

$users = User::all();

// Returns `true` if the collection is not empty.
$users->any();

// Returns `true` if there is a user with a paid plan.
$users->any(fn ($user) => $user->has_paid_plan);

// Returns `true` if there is a user with a paid plan.
$users->any->has_paid_plan;

Contributing

Thank you for considering to contribute to laravel-any. All the contribution guidelines are mentioned here.

You can have a look at the CHANGELOG for constant updates & detailed information about the changes. You can also follow the twitter account for latest announcements or just come say hi!: @enunomaduro

Support the development

Do you like this project? Support it by donating

License

laravel-any is an open-sourced software licensed under the MIT license.

About

πŸ“ Laravel collection macro that determine if `any` item from the collection passes the given truth test.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages