Download the PHP package akankov/laravel-compress-html without Composer

On this page you can find all versions of the php package akankov/laravel-compress-html. 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 laravel-compress-html

CI Latest Stable Version Monthly Downloads Dependents License

laravel-compress-html

Laravel integration for akankov/html-min — adds a Blade @htmlmin block directive, an opt-in HTML response middleware, and a publishable config-driven service provider.

Requirements

Install

The service provider is registered automatically via Laravel's package auto-discovery (extra.laravel.providers in composer.json); no manual config/app.php edit is needed.

Optionally publish the config file to tune the 29 minifier toggles:

This drops config/htmlmin.php into your application — every key defaults to the engine's default, so you only need to edit the ones you want to flip.

Blade directive

The block captures rendered output, then minifies it. Variables interpolated via {{ $expr }} are escaped by Blade before the buffer reaches the minifier, so it's safe to interpolate user data inside.

Response middleware

Opt-in: the service provider does not push the middleware onto the global stack — register it explicitly where you want it.

Globally, in bootstrap/app.php (Laravel 12+):

Or per-route / per-group:

The middleware only touches Illuminate\Http\Response instances whose Content-Type first segment is text/html. JSON, streamed, and binary responses pass through unchanged.

What "pass through" covers, precisely:

Configuration

Every key in config/htmlmin.php is a snake_case mirror of a property on Akankov\HtmlMin\Config\MinifierOptions. The provider converts them with Str::camel() when constructing the options object, so:

See the published config file for the full list of 29 keys with their defaults.

Artisan command

html-min:check minifies a file in memory and reports the byte savings — a CI/dev smoke-check for "did this template change inflate the page?" without writing anything to disk:

It exits 0 on success and 1 if the file cannot be read.

Versioning

This package follows Semantic Versioning. From 1.0.0 onward the public surface — the @htmlmin directive, the MinifyHtmlResponseMiddleware, the html-min:check command, the published config/htmlmin.php keys, and the service-provider bindings — is stable; breaking changes are reserved for a new major version. The underlying engine is tracked via a caret constraint (akankov/html-min: ^2.9), so it picks up engine minor/patch releases automatically.

Tests

The suite holds 100% line coverage, enforced in CI.

License

MIT


All versions of laravel-compress-html with dependencies

PHP Build Version
Package Version
Requires php Version 8.3.* || 8.4.* || 8.5.*
akankov/html-min Version ^2.9
illuminate/contracts Version ^12.0 || ^13.0
illuminate/http Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
illuminate/view Version ^12.0 || ^13.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 akankov/laravel-compress-html contains the following files

Loading the files please wait ...