- What is botble/assets used for in Laravel?
- Botble Assets is a Laravel package for registering, managing, and rendering CSS and JavaScript assets at runtime. It provides asset containers, dependency handling, versioning, localization, and minified output so themes and plugins can contribute assets without editing a central layout. It is the asset-management layer used by the Botble CMS ecosystem.
- How do I install botble/assets with Composer?
- Install it with composer require botble/assets and rely on Laravel package auto-discovery for the service provider and facade, then publish any config the README documents. Because the package is primarily exercised inside Botble CMS, check its composer.json constraints before installing into your app. A quick Blade render that outputs one registered style and script will confirm the pipeline works.
- Which Laravel and PHP versions does botble/assets support?
- The package does not publish an obvious standalone support matrix in the overview, so read its composer.json constraints and repository CI configuration before committing. Asset packages are tightly coupled to Laravel majors and front-end tooling, so confirm the exact PHP and Laravel versions you need are allowed. A short install spike against your target versions is the fastest way to validate compatibility.
- Can I use botble/assets in a plain Laravel app without Botble CMS?
- It is a Laravel package and may run standalone, but its primary consumer is Botble core, so it may assume sibling botble packages, specific config keys, or a particular public asset directory convention. Check for runtime dependencies on other botble/* packages and test a minimal install before adopting it. For a conventional Laravel app already standardized on Vite, the marginal benefit is likely low.
- How does botble/assets handle CSS and JavaScript dependencies?
- The package provides asset containers and dependency handling so styles and scripts can declare relationships and render in the correct order. This is useful when themes and plugins register assets independently at runtime rather than from one central manifest. Verify the exact dependency API and whether circular dependencies are detected by reading the README or source.
- Does botble/assets support cache busting and asset versioning?
- Versioning is listed as part of the package's asset-management feature set, which is typically used to append a version query string or path segment for cache busting. The overview does not detail how versions are invalidated on deploy, so confirm the documented mechanism and test it behind your CDN and proxy setup. Asset URL generation, CDN prefixes, and minification are common production-only failure points.
- Does botble/assets work with Vite, Laravel Mix, or both?
- The overview does not specify whether the package targets Vite, Mix, or both, and its minify pipeline may overlap with either front-end toolchain. Confirm whether you can disable its minifier and use your own build output, and whether it can resolve Vite manifest URLs. If your app is already standardized on laravel-vite-plugin, adopting a second asset registry needs a clear reason such as plugin-contributed assets.
- How do I reset the botble/assets registry between tests?
- The package uses a facade over global asset state, so test isolation depends on a reset or flush hook. The overview does not confirm that such a helper exists, so inspect the source for a clear or reset method and wrap asset registration in your test case teardown. If no hook is available, isolate tests that assert rendered asset output or add a small reset helper yourself.
- Is botble/assets a good alternative to laravel-vite-plugin?
- Only if you genuinely need runtime asset registration from themes or plugins, as in Botble CMS or a marketplace-style extension system. For a standard Laravel app with a Vite build, laravel-vite-plugin is first-party, better documented, and has stronger community support. Botble Assets has thin public adoption, so treat it as a containable MIT-licensed dependency rather than a drop-in Vite replacement.
- Is botble/assets actively maintained and safe for production?
- Public adoption is thin, with a small star count and few recorded dependents, and the primary consumer appears to be Botble's own product. Verify actual commit activity and tag history on the repository rather than assuming active maintenance from release dates. The MIT license and small, auditable codebase make vendoring or forking a realistic fallback if the project stalls.