PHPackages                             hollyit/filament-static-assets - 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. hollyit/filament-static-assets

ActiveLibrary

hollyit/filament-static-assets
==============================

Improved handling of stylesheets and javascript files for Filament

0.1.4(3y ago)1512.9k↓100%3[2 issues](https://github.com/HollyIT/filament-static-assets/issues)MITPHPPHP ^8.0

Since Sep 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/HollyIT/filament-static-assets)[ Packagist](https://packagist.org/packages/hollyit/filament-static-assets)[ Docs](https://github.com/HollyIT/filament-static-assets)[ RSS](/packages/hollyit-filament-static-assets/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (5)Versions (7)Used By (0)

Filament Static Asset Handling
==============================

[](#filament-static-asset-handling)

This package aims to solve improve the static asset handling of the amazing Laravel package [Filament](https://filamentphp.com/).

---

**NOTE:** This package is for Filament served assets only. If you are looking for a general Laravel asset management system that includes the same features as this, plus advanced dependency management, then the newly released [Laravel Static Libraries](https://github.com/HollyIT/laravel-static-libraries) might be of interest.

---

By default Filament serves all static files (js and css) via Laravel. While this method is perfectly fine for smaller projects, it can become a performance hit once your project grows. To overcome the performance hit, this package will copy all your static assets to a path in your public directory, thereby allowing your webserver to directly handle the files. If you add a package with new files and forget run the command, no sweat, things will fallback directly to Filament's default handling.

Another feature of the caching mechanism is the addition of cache buster keys added to the actual URLs. These keys are based off of the filemtime of the original asset file, so even if you republish, browser caching will remain untouched.

To cache your static files, just run this simple command:

```
 php artisan filament:cache-assets
```

And to clear the files out, going back to the original method of handling files:

```
 php artisan filament:flush-assets
```

One problem with this method is that you may easily forget to run the commands when packages are updated. Therefor it is highly recommended to add a script to your composer.json file to handle this automatically:

```
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force",
            "@php artisan filament:upgrade",
            "@php artisan filament:cache-assets" // Add this line
        ],

        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },
```

The second problem this package deals with is the loading of assets on every page. As projects grow and more static assets are added, this can be another performance hit. If you use a package like the [Filament Tiptap Edito](https://filamentphp.com/plugins/tiptap)r or [Filament Tiny Editor](https://filamentphp.com/plugins/tinyeditor), then those files load on every page, regardless of you needing them or not. To stop this, there are two events fired when rendering out scripts and stylesheets:

#### HollyIT\\FilamentStaticAssets\\Events\\PreProcessStaticAssetsEvent

[](#hollyitfilamentstaticassetseventspreprocessstaticassetsevent)

This event is fired before the files are processed and things like cache busting keys are added.

#### HollyIT\\FilamentStaticAssets\\Events\\PostProcessStaticAssetsEvent

[](#hollyitfilamentstaticassetseventspostprocessstaticassetsevent)

This event fires after all alterations are done to the files and ready to be rendered in the template.

Both methods expose the same properties:

`$event->files` is a collection of the actual files. So in the PreProcess event, you could remove a script file: `$event->files->forget('file_to_drop');`

`$event->domain` is the scope of the files. This can be either styles, scripts or beforeCoreScripts

Install
-------

[](#install)

```
composer require hollyit/filament-static-assets
```

One Note!
---------

[](#one-note)

To make all this possible, this package has to override the FilamentManager class provided by Filament. So If you are trying to do anything extra with that concrete class, keep in mind you'll have to echo the changes made by this class.

Testing
-------

[](#testing)

This package is fully tested with 100% coverage.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 57% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

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.

###  Release Activity

Cadence

Every ~43 days

Total

5

Last Release

1116d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/58617d67178941252c10067cd88583a4f1773569b630372930c6412fbc939979?d=identicon)[HollyIT](/maintainers/HollyIT)

---

Top Contributors

[![HollyIT](https://avatars.githubusercontent.com/u/527984?v=4)](https://github.com/HollyIT "HollyIT (8 commits)")

---

Tags

laravelperformanceassetsfilamenthollyit

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/hollyit-filament-static-assets/health.svg)

```
[![Health](https://phpackages.com/badges/hollyit-filament-static-assets/health.svg)](https://phpackages.com/packages/hollyit-filament-static-assets)
```

###  Alternatives

[rupadana/filament-api-service

A simple api service for supporting filamentphp

20399.6k7](/packages/rupadana-filament-api-service)[guava/filament-modal-relation-managers

Allows you to embed relation managers inside filament modals.

7558.0k4](/packages/guava-filament-modal-relation-managers)[caresome/filament-auth-designer

Transform Filament's default auth pages into stunning, brand-ready experiences

3711.7k1](/packages/caresome-filament-auth-designer)[marcogermani87/filament-cookie-consent

Easy cookie consent integrations for Filament

1916.7k](/packages/marcogermani87-filament-cookie-consent)[omar-haris/filament-timezone-field

A Laravel Filament component that enables users to choose a specific timezone grouped by regions, with support for multiple languages.

1713.5k1](/packages/omar-haris-filament-timezone-field)[blendbyte/filament-title-with-slug

TitleWithSlugInput - Easy Permalink Slugs for the FilamentPHP Form Builder (PHP / Laravel / Livewire)

1321.6k3](/packages/blendbyte-filament-title-with-slug)

PHPackages © 2026

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