Download the PHP package peltonsolutions/filament-enums without Composer
On this page you can find all versions of the php package peltonsolutions/filament-enums. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download peltonsolutions/filament-enums
More information about peltonsolutions/filament-enums
Files in peltonsolutions/filament-enums
Package filament-enums
Short Description A custom package for Filament for handling enum values in Filament Admin.
License MIT
Homepage https://github.com/peltonsolutions/filament-enums
Informations about the package 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
You can install the package via composer using the following command:
Example:
This will create a Select component that:
- Gives options from the
map()
function - Makes the field required if it's not
\PeltonSolutions\LaravelEnums\Models\NullableEnum
- Requires that the selected value matches one of the
map()
keys
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.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
License
filament-enums is open-sourced software. It's licensed under the MIT license, which is a permissive license allowing the software to be used, modified, and shared.
All versions of filament-enums with dependencies
filament/filament Version ^3.0.9
peltonsolutions/laravel-enums Version ^1.1
laravel/framework Version ^11.26