PHP code example of awjudd / assetprocessor

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

    

awjudd / assetprocessor example snippets


'providers' => array(

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    'Awjudd\AssetProcessor\AssetProcessorServiceProvider',

),

'aliases' => array(

    'App'             => 'Illuminate\Support\Facades\App',
    'Artisan'         => 'Illuminate\Support\Facades\Artisan',
    ...

    // To make this line, and your code even shorter, you could alias this to 'Asset' instead.
    'AssetProcessor'  => 'Awjudd\AssetProcessor\Facades\AssetProcessorFacade',
    
),

'enabled' => array(

    /**
     * What environments is this processing enabled in?  The environment name
     * here should match that from App::environment()
     * 
     * @var array
     */
    'environments' => array(
        'production'
    ),

    /**
     * Should we force the processor to process the files?
     * 
     * @var boolean
     */
    'force' => false,
),

AssetProcessor::cdn('name', 'http://full/url/to/cdn')

// Works with both files and directories
AssetProcessor::add('name', '/path/to/asset/file');

/**
 * Any assets that should be auto-loaded.
 * 
 * @var array
 */
'autoload' => array(

    /**
     * Any CDN-type assets to auto-load
     * 
     * @var array
     */
    'cdn' => array(
    ),

    /**
     * Any local assets that will need processing.
     * 
     * @var array
     */
    'local' => array(
    ),
),


{!! AssetProcessor::styles() !!}
{!! AssetProcessor::scripts() !!}

AssetProcessor::add('name', '/path/to/asset/file', ['group' => 'foo']);

{!! AssetProcessor::styles('foo') !!}

/**
 * The external path that is the final resting spot for the assets.
 * 
 * @var string
 */
'external' => public_path('assets/generated'),

$ php artisan vendor:publish

$ php artisan assetprocessor:process

$ php artisan assetprocessor:cleanup