Download the PHP package hollyit/filament-static-assets without Composer

On this page you can find all versions of the php package hollyit/filament-static-assets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-static-assets

Filament Static Asset Handling

This package aims to solve improve the static asset handling of the amazing Laravel package Filament.


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 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:

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

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:

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 Editor or Filament Tiny Editor, 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

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

HollyIT\FilamentStaticAssets\Events\PostProcessStaticAssetsEvent

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

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

This package is fully tested with 100% coverage.

License

The MIT License (MIT). Please see License File for more information.


All versions of filament-static-assets with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
filament/filament Version ^2.13
illuminate/contracts Version ^9.0|^10
spatie/laravel-package-tools Version ^1.9.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hollyit/filament-static-assets contains the following files

Loading the files please wait ....