Weave Code
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

appventus/assetic-injector-bundle

View on GitHub
Deep Wiki
Context7

This bundle allow you to define global javascripts and stylesheets

Frequently asked questions about Assetic Injector Bundle
Can I use AsseticInjectorBundle with Laravel 9+ or should I migrate to Laravel Mix/Vite?
No, this bundle is not recommended for Laravel 9+. It’s designed for Symfony/Laravel 4/5 and relies on deprecated Assetic, which conflicts with Laravel’s native asset pipelines (Mix/Vite). Migrate to `@vite()` or `@mix()` directives for modern Laravel apps.
How do I install AsseticInjectorBundle in Laravel 5?
First, install via Composer: `composer require troopers/assetic-injector-bundle`. Then configure it in `app/config/config.yml` (Symfony-style) and update your `AppKernel.php` to include the bundle. Note: Laravel 5’s service container may require manual shimming for Symfony’s `ContainerAware` interfaces.
Will this bundle work with Blade templates in Laravel?
No, the bundle uses Symfony’s Twig `{% block %}` syntax, which conflicts with Laravel’s Blade directives like `@stack` or `@section`. For Laravel, use Blade’s native `@stack('scripts')` or `@push` directives instead.
Does AsseticInjectorBundle support asset fingerprinting like Laravel Mix?
Yes, but it uses Assetic’s runtime fingerprinting (e.g., `/assets/css/app.abc123.css`), which may conflict with Laravel Mix’s `mix-manifest.json` or Vite’s static hashing. For Laravel, pre-compiled assets with Mix/Vite are more reliable.
Is this bundle actively maintained? Should I fork it for Laravel?
The bundle is maintained by Troopers, but it’s primarily for Symfony. For Laravel, consider forking and adapting it to use Laravel’s service providers and Blade stacks. However, migrating to Laravel Mix/Vite is the long-term solution.
Can I use this bundle alongside Laravel Mix for dynamic asset loading?
No, mixing Assetic and Laravel Mix/Vite risks duplicate asset processing or broken hashing. Use Laravel Mix/Vite for pre-compiled assets and Blade’s `@stack` for dynamic injection, or switch entirely to client-side solutions like Alpine.js.
What’s the best alternative for global JS/CSS injection in Laravel 8+?
Use Laravel Mix/Vite for pre-compiled assets and Blade’s `@stack` or `@push` directives for dynamic injection. For runtime asset toggling (e.g., A/B testing), consider Alpine.js or Inertia.js without server-side injection.
How do I configure global assets (e.g., app.js) in Laravel without this bundle?
In Laravel, define global assets in `resources/js/app.js` and compile them with Mix/Vite. Inject them in `resources/views/layouts/app.blade.php` using `@vite(['resources/js/app.js'])` or push them in `AppServiceProvider::boot()` with `view()->pushSection('scripts', '<script>...</script>').`
Will this bundle work with Laravel’s caching (Redis, OPcache) for asset manifests?
No, Assetic’s runtime asset injection bypasses Laravel’s caching layers. For cached manifests, use Laravel Mix/Vite’s `mix-manifest.json` or Vite’s static asset handling, which integrate seamlessly with Laravel’s caching.
Does AsseticInjectorBundle support YAML/XML/annotation-based configuration in Laravel?
Technically yes, but it’s designed for Symfony’s configuration system. In Laravel, you’d need to manually bridge Symfony’s `YamlFileLoader` or `XmlFileLoader` to Laravel’s configuration system, which adds complexity. Laravel’s `config/app.php` or service providers are simpler alternatives.
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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui