PHP code example of debjyotikar001 / asset-optimise

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

    

debjyotikar001 / asset-optimise example snippets


protected $middleware = [
  // other middleware
  \Debjyotikar001\AssetOptimise\Middleware\Minifier::class,
];

protected $middleware = [
  // other middleware
  'assetOptimise',
];

->withMiddleware(function (Middleware $middleware) {
  $middleware->web(append: [
    // other middleware
    \Debjyotikar001\AssetOptimise\Middleware\Minifier::class,
  ]);
})

->withMiddleware(function (Middleware $middleware) {
  $middleware->web(append: [
    // other middleware
    'assetOptimise',
  ]);
})

'enabled' => env('ASSETOPTIMISE_ENABLED', true),

'allowed_envs' => env('ASSETOPTIMISE_ALLOWED_ENVS', 'local,production,staging'),

'skip_css' => env('ASSETOPTIMISE_SKIP_CSS', true),

'skip_js' => env('ASSETOPTIMISE_SKIP_JS', true),

'skip_comment' => env('ASSETOPTIMISE_SKIP_COMMENT', true),

'skip_urls' => [
    '/',
    'about',
    'user/*',
    '*_dashboard',
    '*/download/*',
  ],

'email_enabled' => env('ASSETOPTIMISE_EMAIL_ENABLED', true),

'js_encrypt_domains' => [
    'example.com',
    'example1.com',
    'example2.com',
  ],
sh
php artisan vendor:publish --provider="Debjyotikar001\AssetOptimise\AssetOptimiseServiceProvider"