PHP code example of apsonex / filament-asset-routing

1. Go to this page and download the library: Download apsonex/filament-asset-routing library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

apsonex / filament-asset-routing example snippets


<!-- 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) }}"
/>

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 

filament_asset_route(string $filePath, string $serviceProviderClass)

// Auth will be