Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dragomano/moonshine-heroicons-field
Heroicons selection field for MoonShine
https://github.com/dragomano/moonshine-heroicons-field
heroicons moonshine
Last synced: 5 days ago
JSON representation
Heroicons selection field for MoonShine
- Host: GitHub
- URL: https://github.com/dragomano/moonshine-heroicons-field
- Owner: dragomano
- License: mit
- Created: 2024-04-20T14:47:28.000Z (9 months ago)
- Default Branch: 1.x
- Last Pushed: 2024-12-24T19:22:30.000Z (11 days ago)
- Last Synced: 2024-12-24T19:47:47.115Z (11 days ago)
- Topics: heroicons, moonshine
- Language: PHP
- Homepage:
- Size: 85.9 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MoonShine Heroicons Field
![PHP](https://img.shields.io/badge/PHP-^8.2-blue.svg?style=flat)
[![Coverage Status](https://coveralls.io/repos/github/dragomano/moonshine-heroicons-field/badge.svg?branch=main)](https://coveralls.io/github/dragomano/moonshine-heroicons-field?branch=main)Convenient Heroicons selection field for [MoonShine](https://github.com/moonshine-software/moonshine)
### Support MoonShine versions
| MoonShine | This package |
| --------- | ------------ |
| 2.0+ | 0.x |
| 3.0+ | 1.x |## Installation
```bash
composer require bugo/moonshine-heroicons-field
```## Configuration
You can specify desired default style for icons:
`.env`:
```ini
HEROICONS_STYLE=outline
````config/heroicons-field.php`:
```bash
php artisan vendor:publish --tag=heroicons-field
``````php
/*
* Possible values:
* 's', 'solid' - Solid 24x24, Solid fill
* 'o', 'outline' - Outline 24x24, 1.5px stroke
* 'm', 'mini' - Mini 20x20, Solid fill
* 'c', 'micro' - Micro 16x16, Solid fill
*/
return [
'style' => env('HEROICONS_STYLE', 'solid'),
];
```## Usage
You can use `Icon` field in your resources:
```php
*/
class CustomResource extends ModelResource
{
/**
* @return list
*/
protected function formFields(): iterable
{
return [
Icon::make('Icon')
->searchable()
->useStyle('mini'),
];
}
}
```All use cases of [Blade Heroicons](https://github.com/blade-ui-kit/blade-heroicons#usage) are also available for you.
## Caching
When using icons in Blade templates, be sure to enable [Caching](https://github.com/blade-ui-kit/blade-icons?tab=readme-ov-file#caching).
## 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.