PHP code example of erikaraujo / filament-enum-attributes
1. Go to this page and download the library: Download erikaraujo/filament-enum-attributes library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
erikaraujo / filament-enum-attributes example snippets
use HasColorAttribute;
use HasIconAttribute;
use HasLabelAttribute;
use HasDescriptionAttribute;
use HasFilamentEnumAttributes;
enum Suit: string implements HasColor, HasIcon, HasLabel, HasDescription
{
use HasColorAttribute;
use HasIconAttribute;
use HasLabelAttribute;
use HasDescriptionAttribute;
#[Color(['gray', 'warning'])]
case Clubs = 'clubs';
#[
Color('warning'),
Label('Shine bright'),
]
case Diamonds = 'diamonds';
#[Color('gray')]
#[Label('Club')]
#[Icon('heroicon-o-heart')]
case Hearts = 'hearts';
#[Description('The upside down black heart.')]
case Spades = 'spades';
use ErikAraujo\FilamentEnumAttributes\Attributes\Color;
use ErikAraujo\FilamentEnumAttributes\Attributes\Icon;
use ErikAraujo\FilamentEnumAttributes\Attributes\Label;
use ErikAraujo\FilamentEnumAttributes\Concerns\HasColorAttribute;
use ErikAraujo\FilamentEnumAttributes\Concerns\HasIconAttribute;
use ErikAraujo\FilamentEnumAttributes\Concerns\HasLabelAttribute;
use ErikAraujo\FilamentEnumAttributes\Concerns\HasDescriptionAttribute;
#[Description('descriptions.suits.spades')]
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.