PHPackages                             everully/laravel-enum-on-steroids - 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. everully/laravel-enum-on-steroids

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

everully/laravel-enum-on-steroids
=================================

This package provides Enum trait to speed up the development of Laravel applications.

v0.2.0(1y ago)0139MITPHPPHP ^8.1

Since Jul 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/everully/laravel-enum-on-steroids)[ Packagist](https://packagist.org/packages/everully/laravel-enum-on-steroids)[ Docs](https://github.com/everully/everully/laravel-enum-on-steroids)[ RSS](/packages/everully-laravel-enum-on-steroids/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (4)Versions (8)Used By (0)

Laravel Enum on steroids
========================

[](#laravel-enum-on-steroids)

This package provides Enum trait to speed up the development of Laravel applications.

Requirements
------------

[](#requirements)

- Laravel 9.0 or later.
- PHP 8.1 or later.

Installation
------------

[](#installation)

Install via composer:

```
composer require everully/laravel-enum-on-steroids
```

Usage
=====

[](#usage)

Add the `EnumOnSteroids` trait to your Enum class to add some useful methods.

```
use Everully\LaravelEnumOnSteroids\EnumOnSteroids;

enum StringEnum: string
{
    use EnumOnSteroids;

    case A = 'a';
    case B = 'b';
    case C = 'c';
}
```

Available methods
-----------------

[](#available-methods)

### Equals

[](#equals)

Check if the enum is equal to another enum or a string.

```
StringEnum::A->equals(StringEnum::A); // true

StringEnum::A->equals('a'); // true

StringEnum::A->equals(AnotherEnum::A); // false

StringEnum::A->equals('d'); // false
```

### Values

[](#values)

Return an array all the values of the enum.

```
StringEnum::values(); // ['a', 'b', 'c']
```

### Names

[](#names)

Return an array of all the names of the enum.

```
StringEnum::names(); // ['A', 'B', 'C']
```

### Collection

[](#collection)

Return a Laravel collection of all the values of the enum.

```
StringEnum::collection();
// Illuminate\Support\Collection
```

### Collect

[](#collect)

Return a Laravel collection of all the values of the enum.

```
StringEnum::collect(['a', 'b', 'c']);
// Illuminate\Support\Collection

StringEnum::collect([StringEnum::A, StringEnum::B, StringEnum::C]);
// Illuminate\Support\Collection
```

If provided string or object is not a valid enum value, the collection will not contain it.

```
StringEnum::collect(['a', 'invalid']);
// Only contains 'a'

StringEnum::collect([StringEnum::A, AnotherEnum::B]);
// Only contains 'a'
```

### Has

[](#has)

Returns true if the enum has the provided value.

```
StringEnum::has('a'); // true
StringEnum::has(StringEnum::A); // true
StringEnum::has('invalid'); // false
StringEnum::has(AnotherEnum::A); // false
```

### Has any

[](#has-any)

Returns true if the enum has any of the provided values.

```
StringEnum::hasAny(['a', 'invalid']); // true
StringEnum::hasAny([StringEnum::A, AnotherEnum::A]); // true
StringEnum::hasAny(['invalid', 'invalid2']); // false
StringEnum::hasAny([CopyStringEnum::A, CopyStringEnum::A]); // false
```

### Has all

[](#has-all)

Returns true if the enum has all the provided values.

```
StringEnum::hasAny(['a', 'b']); // true
StringEnum::hasAny([StringEnum::A, AnotherEnum::A]); // true
StringEnum::hasAny(['a', 'invalid']); // false
StringEnum::hasAny([StringEnum::A, CopyStringEnum::A]); // false
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance44

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~37 days

Recently: every ~55 days

Total

7

Last Release

435d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b6666fd468638a22f0dbe063b9c7a8ffd8cad4c8b6d95a305f2ceb8b9bd11375?d=identicon)[everully](/maintainers/everully)

---

Top Contributors

[![everully](https://avatars.githubusercontent.com/u/4862088?v=4)](https://github.com/everully "everully (8 commits)")

---

Tags

phplaravellaravel 9laravel 10laravel 11laravel 12enumseverullylaravel-on-steroids

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/everully-laravel-enum-on-steroids/health.svg)

```
[![Health](https://phpackages.com/badges/everully-laravel-enum-on-steroids/health.svg)](https://phpackages.com/packages/everully-laravel-enum-on-steroids)
```

###  Alternatives

[aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PHP.

1.7k35.6M75](/packages/aws-aws-sdk-php-laravel)[ip2location/ip2location-laravel

Lookup for visitor's IP information, such as country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation and usage type.

83516.9k1](/packages/ip2location-ip2location-laravel)[tuncaybahadir/quar

A simple QR Code generation tool for your projects with Laravel 10, 11, 12 versions, php 8.2, 8.3, 8.4 and 8.5

6966.5k4](/packages/tuncaybahadir-quar)[goodway/laravel-nats

Nats jetstream queue driver with client for Laravel

304.8k](/packages/goodway-laravel-nats)[novu/novu-laravel

Novu for Laravel

12204.3k](/packages/novu-novu-laravel)[ip2location/ip2proxy-laravel

Allows user to query an IP address if it was being used as open proxy, web proxy, VPN anonymizer and TOR exits.

1063.2k](/packages/ip2location-ip2proxy-laravel)

PHPackages © 2026

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