PHP code example of bangnokia / filament-radio-card

1. Go to this page and download the library: Download bangnokia/filament-radio-card 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/ */

    

bangnokia / filament-radio-card example snippets


use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasIcon;
use Filament\Support\Contracts\HasLabel;

enum BotProvider: string implements HasLabel, HasIcon
{
    case Telegram = 'telegram';
    case Discord =  'discord';
    case Slack = 'slack';

    public function getLabel(): ?string
    {
        return $this->name;
    }

    public function getIcon(): ?string
    {
        return match ($this) {
            self::Telegram => 'icon-telegram',
            self::Discord => 'icon-discord',
            self::Slack => 'icon-slack',
        };
    }
}

RadioCard::make('provider')
    ->options(BotProvider::class)
    ->default(BotProvider::Telegram)
    ->columns(count(BotProvider::cases()))