---
title: "Readable labels — Enums for Laravel | Roundly"
description: "readable() and label() turn a case into a human-friendly label with Str::headline(), passed through Laravel’s translator."
url: https://roundly-consulting.com/open-source/docs/enums-for-laravel/labels
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)

# Readable labels

readable() turns a case into a human-friendly label: it runs a string value — or the case name on a pure enum — through Str::headline(), keeping any part that is exactly 0 (Str::headline() alone drops it), takes an int value as-is, then looks the headline up in Laravel’s translator for the current locale. Without a matching translation the headline itself is returned. label() is an alias for UI code that prefers that name:

```php
NewsCategory::HotNews->readable(); // "Hot News"
NewsCategory::HotNews->label();    // "Hot News"

enum Status { use Helpers; case Active; }

Status::Active->readable(); // "Active"
```

## How values become labels

| Case | Label |
| --- | --- |
| `case HotNews = 'hot-news'` | Hot News |
| `case OnHold = 'on_hold'` | On Hold |
| `case InProgress = 'inProgress'` | In Progress |
| `case Pending = 'pending'` | Pending |
| `case Active` | Active (pure enum — the name is used) |
| `case LevelZero = 'level-0'` | Level 0 |
| `case Medium = 5` | 5 (int-backed — the number itself) |
| `case Below = -1` | \-1 (int-backed — the sign is kept) |

The label is derived from the value, not the case name, so choose values that read well — or translate them. Every other label-based helper — label(), labels(), toOptions(), toArray(), options(), presentation(), presentations(), fromLabel() and tryFromLabel() — goes through readable(), so a custom or translated label applies everywhere at once. On an enum marked #\[TranslatedLabels\], a line from its translation group comes before the headline — see Labels from translation files.

Labels come from the application’s translator, so label-producing methods need a booted Laravel app. If a headline happens to name a whole translation group instead of a line — “Auth” matches lang/en/auth.php on a case-insensitive filesystem — the untranslated headline is returned rather than the group.

## All labels at once

```php
NewsCategory::labels()->all(); // ['Hot News', 'Regular News', 'Private News']
```

## 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)
