Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Assetic Injector Bundle

Assetic Injector Bundle Laravel Package

troopers/assetic-injector-bundle

A Symfony bundle for Assetic that makes it easy to inject CSS and JavaScript assets into templates. Register assets from bundles or services and keep front-end dependencies organized without editing every template.

View on GitHub
Deep Wiki
Context7

Troopers Assetic Injector Bundle is a Symfony bundle that simplifies adding CSS and JavaScript assets to Assetic pipelines through configuration. It lets bundles register their assets without manually editing templates or central Assetic config, keeping frontend dependencies organized and maintainable.

  • Config-driven asset injection
  • Integrates with Symfony and Assetic
  • Register assets from individual bundles
  • Keeps templates clean and centralized
  • Reduces manual Assetic configuration
Frequently asked questions about Assetic Injector Bundle
Can I use troopers/assetic-injector-bundle in a Laravel application?
No. Composer may resolve the dependency, but nothing will execute in Laravel: the package is a Symfony bundle that registers through AppKernel::registerBundles() and extends Symfony\Component\HttpKernel\Bundle\Bundle, and it has no service provider, facade, config publishing, or Blade integration. Laravel has no bundle kernel or Assetic integration, so direct installation is not feasible.
What does AsseticInjectorBundle do?
It automatically injects Assetic-managed JavaScript and CSS into your application's responses, so you can define global scripts and stylesheets once instead of adding them to every template. The goal is to reduce template boilerplate and centralize front-end asset inclusion. It is built on Symfony's legacy Assetic asset pipeline.
Is AsseticInjectorBundle a Laravel package?
No, it is a Symfony bundle. It was built for Symfony applications using Assetic, not for Laravel's service container, Blade templates, or Vite/Mix asset pipeline. Its functional intent is portable, but the package code itself is not a Laravel package.
Does troopers/assetic-injector-bundle support Laravel 10 or Laravel 11?
There is no official Laravel support for any version, including Laravel 10 or 11. The last release was in 2017, long before modern Laravel asset handling with Vite. It does not register a service provider or hook into Laravel's view or asset systems.
Is Assetic still maintained, and should I use it with Laravel Vite?
Assetic is effectively abandoned and was removed from the Symfony standard stack around the Symfony 3/4 transition. Laravel's current asset story is Vite (Laravel 9.19+) with Mix as legacy, and there is no Assetic integration. Pinning Assetic in a modern PHP 8.x codebase invites deprecation noise and unpatched pipeline risk.
How much code does it take to replicate global asset injection in Laravel?
The capability is small, roughly 50 to 150 lines of code. A native implementation would use a service provider, a config file listing global scripts and styles with optional environment and route-group scoping, and a Blade directive or view composer that appends script and link tags to a stack. Asset resolution should go through Vite::asset() or the Vite manifest.
Can I fork AsseticInjectorBundle and adapt it for Laravel?
Forking has low value. The upstream logic is thin and tightly bound to Assetic's AssetFactory and FactoryWorker interfaces, so stripping Assetic leaves almost nothing worth keeping, and the Symfony bundle scaffolding would be discarded anyway. Writing a small Laravel-native package is the cleaner path.
Is troopers/assetic-injector-bundle safe to use in production?
It is not a good production choice for a Laravel application. The package has been unmaintained since 2017, has no security-response path, and shows very weak adoption with 19 stars and zero dependents. The underlying Assetic pipeline is also unmaintained, so any production use carries unpatched-risk exposure.
Does AsseticInjectorBundle have tests or CI I can rely on?
The evaluation notes an absence of CI and test evidence. Any behavior claim would need to be validated by reading the source and writing throwaway harness tests. That verification cost is high relative to the small capability being delivered.
What should I use instead of AsseticInjectorBundle in Laravel?
Use Laravel's native Vite integration for asset resolution and a small service provider plus Blade directive or view composer for global injection. If you need environment-scoped globals or per-request overrides, define the ordering semantics explicitly in your config. The original bundle is best treated as a requirements document rather than a dependency.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect