ichinya / moonshine-fontawesome-component
Font Awesome icons selection component for MoonShine
1.1.1
2024-12-20 05:35 UTC
Requires
- php: ^8.1|^8.2
- ext-curl: *
- ext-json: *
- moonshine/moonshine: ^3.0
Requires (Dev)
- orchestra/testbench: ^9.0
- phpunit/phpunit: ^11.0
Conflicts
README
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.