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.1(2w ago)0144MITPHPPHP ^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 2w ago

READMEChangelog (7)Dependencies (8)Versions (9)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

34

—

LowBetter than 74% of packages

Maintenance64

Regular maintenance activity

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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 ~105 days

Recently: every ~180 days

Total

8

Last Release

19d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4862088?v=4)[Anton Antonov](/maintainers/everully)[@everully](https://github.com/everully)

---

Top Contributors

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

---

Tags

phplaravellaravel 9laravel 10laravel 11laravel 12enumslaravel-13everullylaravel-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.7k39.1M90](/packages/aws-aws-sdk-php-laravel)[tuncaybahadir/quar

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

82133.8k6](/packages/tuncaybahadir-quar)[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.

83562.9k1](/packages/ip2location-ip2location-laravel)[salmanzafar/laravel-mqtt

A simple Laravel Library to connect/publish/subscribe to MQTT broker

102158.3k1](/packages/salmanzafar-laravel-mqtt)[goodway/laravel-nats

Nats jetstream queue driver with client for Laravel

356.6k](/packages/goodway-laravel-nats)

PHPackages © 2026

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