PHP code example of elfsundae / laravel-asset-version

1. Go to this page and download the library: Download elfsundae/laravel-asset-version 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/ */

    

elfsundae / laravel-asset-version example snippets


ElfSundae\Laravel\AssetVersion\AssetVersionServiceProvider::class,



return [
    'css/app.css',
    'js/app.js',
    'images/foo.png',
];



return array (
  'css/app.css' => '3ede8f2085',
  'js/app.js' => '2eaf111399',
  'images/foo.png' => 'd41d8cd98f',
);

asset_path('css/app.css');  // "/css/app.css?3ede8f2085"

<link href="{{ asset_path('js/app.js') }}" rel="stylesheet">
js
elixir((mix) => {
    mix.sass('app.scss')
       .webpack('app.js')
       .exec('php artisan asset-version:update');
});