apsonex/filament-asset-routing

This is my package filament-asset-routing

Maintainers

👁 apsonex

Package info

github.com/apsonex/filament-asset-routing

pkg:composer/apsonex/filament-asset-routing

Statistics

Installs: 51

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2023-09-15 13:44 UTC

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 30590f513dbc93612092bef3091453b4fcb9d02f

  • Gurinder Chauhan <dev.woop@apsonex.com>

laravelapsonexfilament-asset-routing

This package is auto-updated.

Last update: 2026-06-15 20:09:02 UTC


README

👁 Latest Version on Packagist
👁 Total Downloads

Filament has built in system to manage assets. But for some reason i want to create a package which helps me in development also.

Purpose

<!-- component.blade.php -->
@php
 use \Apsonex\FilamentSimpleFile\FilamentSimpleFileServiceProvider;
@endphp
<div
 ax-load
 x-load-css="[
 @js(filament_asset_route('resources/dist/plugin.css', FilamentSimpleFileServiceProvider::class)),
 ]"
 ax-load-src="{{ filament_asset_route('resources/dist/plugin.js', FilamentSimpleFileServiceProvider::class) }}"
/>

Above code will create links and package will serve the file as requested with updated timestamp to purge the file cache by browser.

Installation

You can install the package via composer:

composer require apsonex/filament-asset-routing

Usage

use \Apsonex\FilamentAssetRouting\FilamentAssetRouting;
use \Apsonex\FilamentImage\FilamentImageServiceProvider;

FilamentAssetRouting::url('resources/dist/plugin.css', FilamentImageServiceProvider::class) 
// OUTOUT: https://example.com/package/filename.ext?id=file_timestamp

// Authentication will be required to access the file
FilamentAssetRouting::authUrl('resources/dist/plugin.css', FilamentImageServiceProvider::class) 
// OUTPUT: https://example.com/package/filename.ext?id=file_timestamp // authentication required

Helpers functions

filament_asset_route(string $filePath, string $serviceProviderClass)

// Auth will be required to access the file
filament_asset_route_auth(string $filePath, string $serviceProviderClass)

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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