PHPackages                             slexx/assets-manager - 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. slexx/assets-manager

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

slexx/assets-manager
====================

Assets management

231PHP

Since Apr 24Pushed 7y agoCompare

[ Source](https://github.com/slexx1234/assets-manager)[ Packagist](https://packagist.org/packages/slexx/assets-manager)[ RSS](/packages/slexx-assets-manager/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Assets manager
==============

[](#assets-manager)

Пакет для управления скриптами и стилями, он сохраняет порядок загрузки зависимостей, не позволяет несколько раз загрузить один скрипт.

Установка
---------

[](#установка)

```
composer require slexx/assets-manager

```

Использование
-------------

[](#использование)

```
$manager = Slexx\AssetsManager\Manager::getInstance();

$head = $manager->head;
$head->style('app-css', 'https://exmaple.com/assets/css/app.css', ['nunito']);
$head->style('nunito', 'https://fonts.googleapis.com/css?family=Nunito');
echo $head;

$foot = $manager->foot;
$foot->script('app-js', 'https://exmaple.com/assets/js/app.js');
echo $foot;
```

Интеграция
----------

[](#интеграция)

### Laravel

[](#laravel)

#### Установка

[](#установка-1)

В файл `config/app.php` в секцию `providers` нужно добавить:

```
Slexx\AssetsManager\Laravel\AssetsServiceProvider::class,
```

В секцию `aliases`:

```
'Assets' => Slexx\AssetsManager\Laravel\Assets::class,
```

#### Фасад

[](#фасад)

Пример использования фасада:

```
$head = Assets::location('head');
$head->style('app-css', 'https://exmaple.com/assets/css/app.css', ['nunito']);
$head->style('nunito', 'https://fonts.googleapis.com/css?family=Nunito');
echo $head;

$foot = Assets::location('foot');
$foot->script('app-js', 'https://exmaple.com/assets/js/app.js');
echo $foot;
```

### Директивы

[](#директивы)

Есть директивы `script`, `endscript`, `style`, `endstyle` для добовления рессурсов и `assets` для указания места их вывода.

Пример взял из одного проекта:

```
@style('app-css', asset('css/app.css'))
@style('toastr-css', 'https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css')
@style('open-iconic', 'https://cdnjs.cloudflare.com/ajax/libs/open-iconic/1.1.1/font/css/open-iconic.min.css')
@script('app-js', asset('js/app.js'))
@script('toastr-js', 'https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js')
@style('highlight-css', asset('ckeditor/plugins/codesnippet/lib/highlight/styles/default.css'))
@script('highlight-js', asset('ckeditor/plugins/codesnippet/lib/highlight/highlight.pack.js'))
@script('highlight-setup', ['highlight-js'])
    hljs.initHighlightingOnLoad();
@endscript
@script('ajax-setup', ['app-js'])
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': '{{ csrf_token() }}',
        },
    });
@endscript
@script('notifications', ['app-js', 'toastr-js'])
    $(document).ready(function() {
        @foreach(['warning', 'success', 'error', 'info'] as $type)
            @if(session()->has($type))
                toastr.{{ $type }}('', '{{ strip_tags(session()->get($type)) }}', {
                    timeOut: 5000,
                    positionClass: 'toast-bottom-right',
                });
                @php
                    session()->remove($type);
                @endphp
            @endif
        @endforeach
    });
@endscript
@stack('assets')
@assets
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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/d76b1d60ad85fc4479c1a04bf6816cbc12ff9a1c9748ff56f5771c0dac46d042?d=identicon)[slexx](/maintainers/slexx)

---

Top Contributors

[![slexx1234](https://avatars.githubusercontent.com/u/23412450?v=4)](https://github.com/slexx1234 "slexx1234 (1 commits)")

### Embed Badge

![Health badge](/badges/slexx-assets-manager/health.svg)

```
[![Health](https://phpackages.com/badges/slexx-assets-manager/health.svg)](https://phpackages.com/packages/slexx-assets-manager)
```

PHPackages © 2026

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