PHPackages                             laraspells/asset-collector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. laraspells/asset-collector

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

laraspells/asset-collector
==========================

Blade directives to prevent multiple asset (css/js) code insertions.

0162PHP

Since Sep 22Pushed 8y ago1 watchersCompare

[ Source](https://github.com/laraspells/asset-collector)[ Packagist](https://packagist.org/packages/laraspells/asset-collector)[ RSS](/packages/laraspells-asset-collector/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Asset Collector
===============

[](#asset-collector)

Asset collector is a library with set of Blade directives to prevent multiple asset (css/js) code insertions. Asset collector used by LaraSpell for field components who need some css and js code.

For example, if you have view partial `input-select2.blade.php` like this:

```

  @foreach($options as $option)
  {{ $option['label'] }}
  @endforeach

@push('styles')

@endpush

@push('scripts')

$(function() {
  $("select.use-select2").select2();
})

@endpush
```

If you include (using `@include`) that file 2 times, link and scripts code will also rendered 2 times. So it will increase rendered page size and can be trouble for some plugins.

This library is just to prevent that case. Using asset collector, code above will be like this:

```

  @foreach($options as $option)
  {{ $option['label'] }}
  @endforeach

@css('path/to/select2/select2.min.css')
@js('path/to/select2/select2.min.js')
@script

$(function() {
  $("select.use-select2").select2();
})

@endscript
```

Then in master view, you can dump collected assets like this:

```

  ...
  @section('styles')
    @styles()
  @show
  ...

  ...
  @section('scripts')
    @scripts()
  @show

```

Installation
------------

[](#installation)

Run composer command below to install asset-collector:

```
composer require "laraspells/asset-collector"

```

Then open your `config/app.php`, put `LaraSpells\AssetCollectorServiceProvider::class` to 'providers' section:

Thats it!

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/bf2e85e5574fc28f87c28311a5ad7bcbec884e9ea21e88d63639f46ed6af72d1?d=identicon)[emsifa](/maintainers/emsifa)

---

Top Contributors

[![emsifa](https://avatars.githubusercontent.com/u/6297931?v=4)](https://github.com/emsifa "emsifa (7 commits)")

### Embed Badge

![Health badge](/badges/laraspells-asset-collector/health.svg)

```
[![Health](https://phpackages.com/badges/laraspells-asset-collector/health.svg)](https://phpackages.com/packages/laraspells-asset-collector)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
