Installation
Get Boson running in your Laravel project.
Requirements
- PHP 8.2+
- Laravel 12.0+
Install via Composer
composer require davidgut/boson
The package auto-registers its service provider via Laravel's package discovery.
Include CSS & JS
Import the Boson stylesheet in your CSS entry point:
/* resources/css/app.css */
@import '../../vendor/davidgut/boson/resources/css/boson.css';
Import Boson's JavaScript in your JS entry point:
// resources/js/app.js
import '../../vendor/davidgut/boson/resources/js/boson.js';
Then compile your assets as usual with Vite.
Usage
All components are available under the boson:: namespace:
<x-boson::button>Click me</x-boson::button>
<x-boson::card>Content goes here.</x-boson::card>
<x-boson::input label="Email" type="email" name="email" />
Publishing
Publish the config file:
php artisan vendor:publish --tag=boson-config
Publish the views for customization:
php artisan vendor:publish --tag=boson-views