quantavoxel/laravel-bootstrap-component
Laravel package with precompiled Bootstrap 5 assets, ready-to-use Blade UI components (dashboard layout, navbars, modals, alerts), and a flexible, future-proof icon engine supporting multiple icon sets. Publish assets/config with Artisan—no Vite/Webpack setup needed.
Installation:
composer require quantavoxel/laravel-bootstrap-component
Run migrations (if applicable) and publish assets/config:
php artisan vendor:publish --provider="QuantaVoxel\BootstrapComponent\BootstrapComponentServiceProvider" --tag="config"
php artisan vendor:publish --provider="QuantaVoxel\BootstrapComponent\BootstrapComponentServiceProvider" --tag="assets"
First Use Case: Render a pre-built component (e.g., navbar) in a Blade view:
<x-bootstrap::navbar title="My App" brand-link="/">
<x-slot name="items">
<x-bootstrap::nav-item href="/">Home</x-bootstrap::nav-item>
<x-bootstrap::nav-item href="/about">About</x-bootstrap::nav-item>
</x-slot>
</x-bootstrap::navbar>
Where to Look First:
resources/docs/ (if published) or the GitHub README.vendor/quantavoxel/laravel-bootstrap-component/src/View/Components/ for available components.config/bootstrap-component.php for global settings (e.g., default icon set, asset paths).Component-Based UI Development:
<x-bootstrap::* /> tags for reusable UI elements (e.g., <x-bootstrap::alert type="success" />).<x-bootstrap::card title="User Profile">
<x-slot name="content">
{{ $user->bio }}
</x-slot>
</x-bootstrap::card>
Icon System Integration:
config/bootstrap-component.php:
'icons' => [
'default' => 'lucide', // or 'fontawesome', 'solar', etc.
],
<x-bootstrap::button icon="home" />
<x-bootstrap::icon name="home" set="solar" />
Asset Management:
@vite or @mix directives needed.assets tag and modifying public/vendor/bootstrap-component/css/app.css.Extending Components:
php artisan vendor:publish --tag="bootstrap-components"
resources/views/vendor/bootstrap-component/.'dark_mode' => env('BOOTSTRAP_DARK_MODE', false),
@lang directives for multi-language projects.Asset Conflicts:
config/bootstrap-component.php:
'assets' => [
'css' => false,
'js' => false,
],
Then manually include your preferred version.Icon Set Mismatches:
config/bootstrap-component.php and ensure the icon exists in the set (e.g., lucide vs. fontawesome).Component Overrides:
php artisan vendor:publish --tag="bootstrap-components" after updating the package to merge changes.Blade Component Namespace:
x-bootstrap::* not resolving.config/app.php and the package is installed correctly.public/vendor/bootstrap-component/ after publishing.php artisan view:clear if components fail to render.php artisan config:clear to reset config if changes aren’t applying.'icons' => [
'debug' => true, // Logs missing icons to Laravel logs
],
Custom Icon Sets:
IconServiceProvider or publishing the config to add a custom provider.Global Component Modifiers:
global_modifiers config array to apply classes to all components:
'global_modifiers' => [
'navbar' => 'bg-dark',
],
Dynamic Asset Loading:
@if(auth()->check())
@bootstrapComponentScript('custom-js')
@endif
Testing:
render() helper:
$html = \Illuminate\Support\Facades\Blade::render('<x-bootstrap::navbar />');
How can I help you explore Laravel packages today?