ichinya/moonshine-fontawesome-component

Font Awesome icons selection component for MoonShine

1.1.1 2024-12-20 05:35 UTC

This package is auto-updated.

Last update: 2024-12-20 05:52:18 UTC


README

PHP

Requirements

  • MoonShine v3.0+

Installation

composer require ichinya/moonshine-fontawesome-component

Usage

You can use FontAwesome component in your resources:

<?php

declare(strict_types=1);

use Ichinya\FontAwesome\Components\FontAwesome;

use MoonShine\Laravel\Resources\ModelResource;

/**
 * @extends ModelResource<Custom>
 */
class CustomResource extends ModelResource
{
    public function fields(): array
    {
        return [
             Select::make('Тип', 'type')->options([
//                    TelegramBot::class => FontAwesome::make('<i class="fa-brands fa-telegram"></i>' , 'blue'),
                    TelegramBot::class =>  Badge::make(FontAwesome::make('<i class="fa-brands fa-telegram"></i>' , 'blue') . 'Telegram', 'blue'),

                ]),
        ];
    }
}

Plans

  • Macros to Fields.
  • fa-brands fa-telegram => telegram
  • Add more customization options for the FontAwesome Component.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.