PHP code example of tarik02 / assets-manifest

1. Go to this page and download the library: Download tarik02/assets-manifest 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/ */

    

tarik02 / assets-manifest example snippets


use Tarik02\AssetsManifest\ManifestLoader;

$assets = ManifestLoader::from('/path/to/project/public/assets')
    ->load('https://example.test/public/assets')
);

$this->app->singleton(
    'assets',
    fn () => ManifestLoader::from(public_path('assets'))
        ->load(url('assets'))
);

// ...

app('assets')->url('img/image.png'); // http://example.test/assets/img/image.deadbeef.png

app('assets')->path('img/image.png'); // /path/to/project/public/assets/img/image.deadbeef.png


$entrypoint = app('assets')->entrypoints->