Download the PHP package debjyotikar001/asset-optimise without Composer

On this page you can find all versions of the php package debjyotikar001/asset-optimise. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package asset-optimise

Asset Optimise for Laravel

Asset Optimise is a powerful and lightweight Laravel package designed to enhance the performance of your web applications by optimizing front-end assets. This package automatically minifies HTML, CSS, and JavaScript code to reduce file sizes, improve page load times and save bandwidth.

Key Features:

  1. Minifies HTML, CSS, and JavaScript for faster loading. Read More...
  2. Configurable to skip minification for HTML comments.
  3. Supports excluding specific sections of code from being minified using custom HTML comments. Read More...
  4. Supports excluding specific routes urls paths from being minified. Read More...
  5. Configurable to skip minification for specific application Environment. Read More...
  6. Easy integration with Laravel's middleware system. Read More...
  7. Supports Email (HTML, CSS, and JavaScript) minification. Read More...
  8. Support multiple assets (CSS or JavaScript) merge and minify. Read More...
  9. Support asset (CSS or JavaScript) minification. Read More...
  10. Extensible for future updates, including image compression and CDN integration.

Installation

Asset Optimise for Laravel requires PHP 8.0 or higher. This particular version supports Laravel 9.x, 10.x, and 11.x.

To get the latest version, simply require the project using Composer:

Configuration

Asset Optimise for Laravel supports optional configuration. To get started, you'll need to publish all vendor assets:

This will create a config/assetoptimise.php file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package.

Register the Middleware

In order to add asset optimization functionality in Laravel, you need to add the Minifier middleware.

(Laravel 10 or older)

In app/Http/Kernel.php file:

or

You can use the middleware class or middleware alias assetOptimise in web middleware or route.

(Laravel 11 or newer)

In bootstrap/app.php file:

or

You can use the middleware class or middleware alias assetOptimise in web middleware or route.

Usage

This is how you can use AssetOptimise for Laravel in your project.

Enable

You must set true on enabled in the config/assetoptimise.php file enable asset optimization functionality. For example:

Allowed Environments

If you want to disable it in specific environments such as during local development or testing to simplify debugging. Then set environments values in a comma (,) separated string in the config/assetoptimise.php file, default local,production,staging. For example:

Skip specific sections of code

If you want to skip specific sections of code from being minified using <!-- no-optimise --> ... <!-- /no-optimise --> HTML comments. This sections supports HTML, CSS and JavaScript code. For example:

Skip Inline CSS

If you want to skip inline CSS (within <style> tags in your HTML) optimization. Then set true on skip_css in the config/assetoptimise.php file, default false. For example:

Skip Inline JavaScript

If you want to skip inline JavaScript (within <script> tags in your HTML) optimization. Then set true on skip_js in the config/assetoptimise.php file, default false. For example:

Skip HTML Comments

If you want to skip all HTML comments from the output. Then set true on skip_comment in the config/assetoptimise.php file, default false. For example:

Skip or Ignore specific Routes Urls

If you want to skip or ignore specific routes urls, then you have to set paths in the config/assetoptimise.php file. You can use '*' as wildcard. For example:

Example URLs:

Enable Email Optimise

You must set true on email_enabled in the config/assetoptimise.php file to enable asset optimization functionality for emails. For example:

Merge and Minify multiple assets (CSS or JavaScript)

You can use mergeAssets() helper function that allows you to merge and minify your multiple CSS or JavaScript files. This function will handle both public and resources directories, storing the final output file in your storage folder for optimized use. It reduces the number of HTTP requests and speeds up the loading of assets.

How It Works

The mergeAssets() helper function accepts four parameters:

Example (CSS)

The file paths can be from both the public and resources/css directories. It returns merged-css.min.css file url.

Example (JS)

The file paths can be from both the public and resources/js directories. It returns merged-js.min.js file url.

Minify asset (CSS or JavaScript)

You can use minifyAsset() helper function that allows you to minify your CSS or JavaScript file. This function will handle both public and resources directories, storing the final output file in your storage folder for optimized use. It helps you to reduce file size, improve page load times and save bandwidth.

How It Works

The minifyAsset() helper function accepts four parameters:

Example (CSS)

The file paths can be from both the public and resources/css directories. It returns app-minify.min.css file url.

Example (JS)

The file paths can be from both the public and resources/js directories. It returns custom.min.js file url.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are welcome! Please see CONTRIBUTING for details on how to get started.

License

Asset Optimise is licensed under the MIT license.

Credits

This package uses the hexydec/htmldoc library for HTML, CSS and JavaScript minification.

Support

If you are having general issues with this package, feel free to contact us on [email protected]


All versions of asset-optimise with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
illuminate/support Version ^9.0|^10.0|^11.0
illuminate/http Version ^9.0|^10.0|^11.0
hexydec/htmldoc Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package debjyotikar001/asset-optimise contains the following files

Loading the files please wait ....