---
title: "Installation — Enums for Laravel | Roundly"
description: "Install with Composer — there is no service provider, config, migration or command to publish or register."
url: https://roundly-consulting.com/open-source/docs/enums-for-laravel/installation
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Enums for Laravel](https://roundly-consulting.com/open-source/docs/enums-for-laravel.md)

# Installation

Require the package with Composer:

```bash
composer require roundly-consulting/enums-for-laravel
```

That’s the whole setup. Enums for Laravel is built around a single trait: it ships no service provider, config file, migrations, views or Artisan commands, so there’s nothing to publish, migrate or register. There’s no facade either: the helpers live on your own enums, so there’s no stateful API to route through one. The code lives in a handful of classes:

- RoundlyConsulting\\Enums\\Helpers — the trait you add to your enums.
- RoundlyConsulting\\Enums\\DataTransferObjects\\EnumOption — the value/label/name DTO returned by options().
- RoundlyConsulting\\Enums\\DataTransferObjects\\EnumPresentation — the value/label/color DTO returned by presentation() and presentations().
- RoundlyConsulting\\Enums\\Attributes\\TranslatedLabels — the attribute that reads labels from a translation group.
- RoundlyConsulting\\Enums\\Contracts\\HasColor — the interface that gives cases a display colour.
- RoundlyConsulting\\Enums\\Exceptions\\EnumException — thrown when fromName() or fromLabel() finds no case, random() meets an enum with no cases, validationRule() can’t represent a value, untranslated() meets an enum without #\[TranslatedLabels\], or a #\[TranslatedLabels\] group is invalid.

## Generate an enum

Laravel’s own make:enum command scaffolds the enum — pass --string or --int for a backed enum. It lands in app/Enums when that directory exists:

```bash
php artisan make:enum NewsCategory --string
```

Then add the trait, as shown in Quick start.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/enums-for-laravel.md)
