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

Assets Push Bundle Laravel Package

braunstetter/assets-push-bundle

View on GitHub
Deep Wiki
Context7

AssetsPushBundle

Scrutinizer Code Quality Build Status Total Downloads License

Push your assets from everywhere inside your templates into the <head>.

Installation

composer require braunstetter/assets-push-bundle

Usage

After the installation you can use the two tags from each template to register additional resources.

{% css '/breadcrumbs.css' %}
{% js '/breadcrumbs.js' %}

After that you are able to query the assets with the assets() function.

It will give you an array of assets like that:

[
    'css' => [
        '/breadcrumbs.css',
        '/custom.css',
        '/app.css',
    ],
    
    'js' => [
        '/breadcrumbs.js'
    ],
]

Now you can use this on top of your pages:


<head>
    <meta charset="UTF-8">
    <title>{% block title %}Welcome!{% endblock %}</title>

    {% block metadata %}{% endblock %}
    
    {% block pushedJs deferred %}
    {% for asset in assets()['js'] %}
        <script src="{{ asset(asset) }}" defer></script>
    {% endfor %}
    {% endblock %}

    {% block pushedCSS deferred %}
    {% for asset in assets()['css'] %}
        <link rel="stylesheet" href="{{ asset(asset) }}">
    {% endfor %}
    {% endblock %}
</head>

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