PHPackages                             nunomaduro/laravel-any - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nunomaduro/laravel-any

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nunomaduro/laravel-any
======================

Determine if any item from the collection passes the given truth test.

v1.0.1(6y ago)37102MITPHPPHP ^7.2CI failing

Since Feb 6Pushed 6y ago1 watchersCompare

[ Source](https://github.com/nunomaduro/laravel-any)[ Packagist](https://packagist.org/packages/nunomaduro/laravel-any)[ RSS](/packages/nunomaduro-laravel-any/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (3)Used By (0)

 [![Any example](https://raw.githubusercontent.com/nunomaduro/laravel-any/master/docs/example.png)](https://raw.githubusercontent.com/nunomaduro/laravel-any/master/docs/example.png)

 [![Build Status](https://camo.githubusercontent.com/a486eed4e6268349dc95b5e1c24d714aa4fe80f1bcf77d5677d84a37724eb8bf/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e756e6f6d616475726f2f6c61726176656c2d616e792f6d61737465722e737667)](https://travis-ci.org/nunomaduro/laravel-any) [![Total Downloads](https://camo.githubusercontent.com/f193d473c670c926159308565b44eb79c37e60fddaedbe8408ef3b56e97edf4a/68747470733a2f2f706f7365722e707567782e6f72672f6e756e6f6d616475726f2f6c61726176656c2d616e792f642f746f74616c2e737667)](https://packagist.org/packages/nunomaduro/laravel-any) [![Latest Version](https://camo.githubusercontent.com/bcd006bc6bc9e97bed1421fb00d30d98b888471ae9a7951b7e3d50cc64ed92a6/68747470733a2f2f706f7365722e707567782e6f72672f6e756e6f6d616475726f2f6c61726176656c2d616e792f762f737461626c652e737667)](https://packagist.org/packages/nunomaduro/laravel-any) [![License](https://camo.githubusercontent.com/e698ceb57caaf46ae4dfc808a704cbfa06f2c672e6f513145942d9784d72c2b1/68747470733a2f2f706f7365722e707567782e6f72672f6e756e6f6d616475726f2f6c61726176656c2d616e792f6c6963656e73652e737667)](https://packagist.org/packages/nunomaduro/laravel-any)

About laravel-any
-----------------

[](#about-laravel-any)

laravel-any was created by, and is maintained by [Nuno Maduro](https://github.com/nunomaduro), and is an Laravel collection macro that determine if any item from the collection passes the given truth test.

Installation &amp; Usage
------------------------

[](#installation--usage)

> **Requires [PHP 7.2+](https://php.net/releases/)**

Create your package using [Composer](https://getcomposer.org):

```
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
------------

[](#contributing)

Thank you for considering to contribute to laravel-any. All the contribution guidelines are mentioned [here](CONTRIBUTING.md).

You can have a look at the [CHANGELOG](CHANGELOG.md) for constant updates &amp; detailed information about the changes. You can also follow the twitter account for latest announcements or just come say hi!: [@enunomaduro](https://twitter.com/enunomaduro)

Support the development
-----------------------

[](#support-the-development)

**Do you like this project? Support it by donating**

- PayPal: [Donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L)
- Patreon: [Donate](https://www.patreon.com/nunomaduro)

License
-------

[](#license)

laravel-any is an open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2288d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/86cfef5c1f5195df1a9db17a5f8ecb34455e1f0133a725de9acf7f2fb26ac6a1?d=identicon)[nunomaduro](/maintainers/nunomaduro)

---

Top Contributors

[![nunomaduro](https://avatars.githubusercontent.com/u/5457236?v=4)](https://github.com/nunomaduro "nunomaduro (17 commits)")[![michapietsch](https://avatars.githubusercontent.com/u/26749587?v=4)](https://github.com/michapietsch "michapietsch (2 commits)")[![mickaelandrieu](https://avatars.githubusercontent.com/u/1247388?v=4)](https://github.com/mickaelandrieu "mickaelandrieu (2 commits)")

---

Tags

anycollectionhelperlaravelmacropackagephplaravelpackagecollectionany

### Embed Badge

![Health badge](/badges/nunomaduro-laravel-any/health.svg)

```
[![Health](https://phpackages.com/badges/nunomaduro-laravel-any/health.svg)](https://phpackages.com/packages/nunomaduro-laravel-any)
```

###  Alternatives

[nunomaduro/essentials

Just better defaults for your Laravel projects.

1.2k317.5k51](/packages/nunomaduro-essentials)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)[werxe/laravel-collection-macros

Custom Laravel Collection macros.

2625.8k](/packages/werxe-laravel-collection-macros)[jshannon63/jsoncollect

Supercharge your JSON using collections

154.9k1](/packages/jshannon63-jsoncollect)[wujunze/money-wrapper

MoneyPHP Wrapper

113.8k](/packages/wujunze-money-wrapper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
