husamhammad / voyager-bootstrap-icons-field
Bootstrap Icons picker FormField for Voyager with zero-config + optional one-shot installer.
Package info
github.com/husamhammadcom/voyager-bootstrap-icons-field
Language:Blade
pkg:composer/husamhammad/voyager-bootstrap-icons-field
v1.0.0
2025-10-09 22:19 UTC
Requires
- php: >=8.0
- tcg/voyager: ^1.6
README
A Bootstrap Icons picker custom FormField for Voyager (Laravel Admin).
Provides a clean modal UI with search, preview, and full integration in BREAD.
📸 Screenshots
Here are some previews of the icon picker inside Voyager BREAD:
✨ Features
- Zero-config auto-discovery (Laravel 8/9/10/11).
- Bootstrap Icons modal picker with live search and preview.
- Ships with
icons.jsonready-to-use (no extra steps). - RTL friendly (Arabic, Persian, etc).
- Optional one-shot installer to auto-wire local provider if needed.
- Supports Browse/Read display via custom view.
🚀 Installation
composer require husamhammad/voyager-bootstrap-icons-field
Optional: publish assets if you want to overwrite
icons.json:
php artisan vendor:publish --tag=public --force
⚙️ One-shot Installer (optional)
If icon field type does not appear in BREAD automatically, run:
php artisan voyager:icon-field:install
This will:
- Create
app/Providers/VoyagerFormFieldsServiceProvider.php(if missing). - Register it in
config/app.php. - Ensure
public/vendor/bootstrap-icons/icons.jsonexists. - Clear caches.
✅ Verify installation
php artisan voyager:icon-field:test
Expected output:
View loaded: YES
Class autoload: YES
icons.json present: YES
🔧 Usage in BREAD
- Add a
VARCHARcolumn to your table, e.g.icon. - In Voyager BREAD, set Type = icon.
- (Optional) For Browse/Read view, add this in Details:
{ "view": "voyager-icon-field::formfields.icon-display" }
Now you can pick an icon in Add/Edit forms and display it in Browse/Read.
🖼 Example in Blade
<i class="bi bi-{{ $model->icon }}"></i>
📝 License
MIT © Husam Hammad