PHPackages                             peltonsolutions/filament-enums - 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. peltonsolutions/filament-enums

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

peltonsolutions/filament-enums
==============================

A custom package for Filament for handling enum values in Filament Admin.

1.2.0(6mo ago)2145MITPHPPHP ^8.2

Since Feb 5Pushed 6mo agoCompare

[ Source](https://github.com/peltonsolutions/filament-enums)[ Packagist](https://packagist.org/packages/peltonsolutions/filament-enums)[ Docs](https://github.com/peltonsolutions/filament-enums)[ RSS](/packages/peltonsolutions-filament-enums/feed)WikiDiscussions main Synced 1mo ago

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

filament-enums
==============

[](#filament-enums)

filament-enums is an extension to the peltonsolutions/laravel-enums package, designed specifically for Laravel developers. This package simplifies working with enumerated values in your Filament applications, thus enhancing the readability and maintainability of your code.

Like the laravel-enums package, filament-enums supports the use of named constants, improving the organization and clarity of your code. It leverages the features provided by laravel-enums, complementing them with additional functionalities tailored for Filament.

Optionally, this package allows you to make your Enum fields nullable through the `NullableEnum` class extension.

Install
-------

[](#install)

You can install the package via composer using the following command:

```
composer require peltonsolutions/filament-enums
```

Example:

```
class ContentPageStatus extends \PeltonSolutions\LaravelEnums\Models\Enum
{
	const DRAFT = 'draft';
	const SCHEDULED = 'scheduled';
	const PUBLISHED = 'published';
	const ARCHIVED = 'archived';

	public static function map(): array
	{
		return [
			static::DRAFT => trans('content_page.statuses.draft'),
			static::SCHEDULED => trans('content_page.statuses.scheduled'),
			static::PUBLISHED => trans('content_page.statuses.published'),
			static::ARCHIVED => trans('content_page.statuses.archived'),
		];
	}
}
```

```
class ContentPage extends Model
{
	protected $casts = [
		'status' => ContentPageStatus::class
	];
}
```

```
class ContentPageResource extends Resource
{
	protected static ?string $model = ContentPage::class;

	public static function form(Form $form): Form
	{
		return $form
			->schema([
				\PeltonSolutions\FilamentEnums\Models\Forms\Components\EnumSelect::make('status')
						  ->default(ContentPageStatus::DRAFT);
	}
}
```

This will create a Select component that:

1. Gives options from the `map()` function
2. Makes the field required if it's not `\PeltonSolutions\LaravelEnums\Models\NullableEnum`
3. Requires that the selected value matches one of the `map()` keys

Testing
-------

[](#testing)

To ensure that laravel-enums is functioning correctly, you can run the package's tests using:

**NOTE: Tests are WIP. Having troubles writing tests that require the `$record` to tbe passed into the closures.**

```
composer test
```

### Security

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Nathan Pelton](https://www.nathanpelton.com)

License
-------

[](#license)

filament-enums is open-sourced software. It's licensed under the [MIT license](https://opensource.org/licenses/MIT), which is a permissive license allowing the software to be used, modified, and shared.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance67

Regular maintenance activity

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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

Total

7

Last Release

191d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ded85d0d1dc28dd8ed6029f3daabce49292c91c5a0482fe99a61261776fa275?d=identicon)[peltonsolutions](/maintainers/peltonsolutions)

---

Top Contributors

[![nathanpelton](https://avatars.githubusercontent.com/u/29257226?v=4)](https://github.com/nathanpelton "nathanpelton (22 commits)")

---

Tags

laravelfilamentpeltonsolutionsfilament-enums

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/peltonsolutions-filament-enums/health.svg)

```
[![Health](https://phpackages.com/badges/peltonsolutions-filament-enums/health.svg)](https://phpackages.com/packages/peltonsolutions-filament-enums)
```

###  Alternatives

[jibaymcs/filament-tour

Bring the power of DriverJs to your Filament panels and start a tour !

12247.8k](/packages/jibaymcs-filament-tour)[aymanalhattami/filament-context-menu

context menu (right click menu) for filament

9838.0k](/packages/aymanalhattami-filament-context-menu)[tapp/filament-google-autocomplete-field

Filament plugin that provides a Google Autocomplete field

3098.1k](/packages/tapp-filament-google-autocomplete-field)[defstudio/filament-searchable-input

A searchable autocomplete input for Filament forms

3212.4k](/packages/defstudio-filament-searchable-input)[agencetwogether/hookshelper

Simple plugin to toggle display hooks available in current page.

2312.7k](/packages/agencetwogether-hookshelper)[marcogermani87/filament-cookie-consent

Easy cookie consent integrations for Filament

1917.0k](/packages/marcogermani87-filament-cookie-consent)

PHPackages © 2026

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