- How do I install Laravel Cube in my Laravel 12/13 project?
- Run `composer require nasirkhan/laravel-cube` in your project directory. The package auto-registers its service provider, so no additional configuration is needed unless you want to customize views or CSS. Ensure your project uses PHP 8.3+ and Laravel 11/12/13.
- Can I use Tailwind CSS and Bootstrap 5 components side-by-side in the same Laravel app?
- Yes, Laravel Cube supports per-component framework switching. For example, use `<x-cube::button framework='tailwind'>` for Tailwind or `<x-cube::button framework='bootstrap'>` for Bootstrap 5. You can also set a global default in your config.
- Does Laravel Cube work with Livewire 3 or 4?
- Yes, the package is explicitly designed for Livewire 3 and 4 compatibility. Components like modals and buttons integrate seamlessly with Livewire’s reactivity. No additional setup is required beyond installing the package.
- How do I customize the default styles or publish views for Laravel Cube?
- Run `php artisan vendor:publish --tag=cube-views` to publish Blade views, then override them in `resources/views/vendor/cube`. For CSS customization, publish assets with `php artisan vendor:publish --tag=cube-assets` and modify the published files.
- Which Laravel versions are officially supported by Laravel Cube?
- Laravel Cube officially supports Laravel 11, 12, and 13. It requires PHP 8.3 or higher. Always check the package’s documentation for the latest compatibility details, as minor updates may extend support.
- Is Laravel Cube suitable for production use, or is it more of a prototype tool?
- Laravel Cube is production-ready and actively maintained. It’s used in Laravel Starter, a production-grade project. However, evaluate its adoption (currently low) and test components thoroughly in your stack, especially if you rely on dark mode or Livewire interactions.
- What are the risks of mixing Tailwind and Bootstrap 5 components in the same app?
- The primary risk is inconsistent styling if components rely on conflicting CSS utilities or classes. Laravel Cube mitigates this by isolating frameworks per component, but you must ensure your app’s global styles (e.g., variables, fonts) align with both frameworks. Test thoroughly in dark mode if enabled.
- Are there alternatives to Laravel Cube for reusable Blade components?
- Yes, alternatives include Laravel Breeze (simpler, opinionated), Jetstream (feature-rich but heavier), or standalone Tailwind/Bootstrap component libraries like Flowbite or Bootstrap Icons. Cube stands out for its dual-framework support and Livewire integration, but choose based on your project’s needs.
- How do I enable dark mode for Tailwind-based components in Laravel Cube?
- Dark mode is built into Tailwind-based components. Ensure your `tailwind.config.js` includes the `dark` variant and your app has a dark mode toggle (e.g., via JavaScript or CSS classes). Cube components will automatically adapt if the parent element has `dark:` classes.
- Can I use Laravel Cube with micro-frontends or is it designed for monolithic apps?
- Laravel Cube is optimized for monolithic Laravel applications using Blade. While you can use individual components in micro-frontend setups, the package assumes a shared Blade environment and may not integrate smoothly with frontend frameworks like React or Vue without additional effort.