2017 © Pedro Peláez
 

library htmlmin

HTMLMin Is A Simple HTML Minifier For Laravel 5

image

graham-campbell/htmlmin

HTMLMin Is A Simple HTML Minifier For Laravel 5

  • Wednesday, July 26, 2017
  • by graham-campbell
  • Repository
  • 23 Watchers
  • 410 Stars
  • 285,748 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 49 Forks
  • 2 Open issues
  • 29 Versions
  • 3 % Grown

The README.md

Laravel HTMLMin

Laravel HTMLMin is currently maintained by Raza Mehdi, and is a simple HTML minifier for Laravel. It utilises Mr Clay's Minify package to minify entire responses, but can also minify blade at compile time. Feel free to check out the change log, releases, license, and contribution guidelines., (*1)

Tests Software License Latest Version , (*2)

Installation

Laravel HTMLMin requires PHP 5.5+. This particular version supports Laravel 5.1-5.8, 6.x, 7.x and 8.x., (*3)

To get the latest version, simply require the project using Composer:, (*4)

$ composer require htmlmin/htmlmin

Once installed, register the service provider in your config/app.php, (*5)

'providers' => [
    HTMLMin\HTMLMin\HTMLMinServiceProvider::class
]

If you want, a facade is available to alias, (*6)

'aliases' => [
    'HTMLMin' => HTMLMin\HTMLMin\Facades\HTMLMin::class
]

Configuration

Laravel HTMLMin supports optional configuration., (*7)

To get started, you'll need to publish all vendor assets:, (*8)

$ php artisan vendor:publish

This will create a config/htmlmin.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 between releases., (*9)

There are three config options:, (*10)

Automatic Blade Optimizations

This option ('blade') enables minification of the blade views as they are compiled. These optimizations have little impact on php processing time as the optimizations are only applied once and are cached. This package will do nothing by default to allow it to be used without minifying pages automatically. The default value for this setting is false., (*11)

Force Blade Optimizations

This option ('force') forces blade minification on views where there such minification may be dangerous. This should only be used if you are fully aware of the potential issues this may cause. Obviously, this setting is dependent on blade minification actually being enabled. The default value for this setting is false., (*12)

Ignore Blade Files

This option ('ignore') is where you can specify paths, which you don't want to minify. A sensible default for this setting is provided., (*13)

Usage

HTMLMin

This is the class of most interest. It is bound to the ioc container as 'htmlmin' and can be accessed using the Facades\HTMLMin facade. There are four public methods of interest., (*14)

The 'blade' method will parse a string as blade and minify it as quickly as possible. This is method the compiler class uses when blade minification is enabled., (*15)

The 'css' and 'js' methods will parse a string as css/js and will minify it using Mr Clay's Minify package., (*16)

The 'html' method will parse a string as html and will minify it as best as possible using Mr Clay's Minify package. It will also be able to minify inline css and js. This is the method that is used by the minification middleware., (*17)

Facades\HTMLMin

This facade will dynamically pass static method calls to the 'htmlmin' object in the ioc container which by default is the HTMLMin class., (*18)

Minifiers\MinifierInterface

This interface defines the public method a minifier class must implement. Such a class must only provide a 'render' method which takes one parameter as a string, and should return a string. This package ships with 4 implementations of this interface, but these classes are not intended for public use, so have no been documented here. You can see the source here., (*19)

Http\Middleware\MinifyMiddleware

You may put the HTMLMin\HTMLMin\Http\Middleware\MinifyMiddleware middleware in front of your routes to live minify them. Note that this middleware allows you to achieve maximal results, though at a performance cost because of it running on each request instead of once like the built in blade minification. It may be useful for you to take a look at the source for this, read the tests, or check out Laravel's documentation if you need to., (*20)

Skipping Minification

As well as being able to skip folders using the ('ignore') config, there are occasions where you will want to 'skip' single files., (*21)

Just add the following comment to each file you want to skip:, (*22)

<!-- skip.minification -->

Please note that if you use ('force') option in the config it will not work., (*23)

HTMLMinServiceProvider

This class contains no public methods of interest. This class should be added to the providers array in config/app.php. This class will setup ioc bindings and register automatic blade minification based on the config., (*24)

Further Information

There are other classes in this package that are not documented here (such as the compiler class). This is because they are not intended for public use and are used internally by this package., (*25)

Please note to clear view cache to see changes., (*26)

php artisan view:clear

Security

If you discover a security vulnerability within this package, please send an e-mail to Raza Mehdi at srmk@outlook.com. All security vulnerabilities will be promptly addressed., (*27)

License

Laravel HTMLMin is licensed under The MIT License (MIT)., (*28)

The Versions

26/07 2017

dev-master

9999999-dev

HTMLMin Is A Simple HTML Minifier For Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Graham Campbell
by Raza Mehdi

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

01/01 2017

v4.5.0

4.5.0.0

HTMLMin Is A Simple HTML Minifier For Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

28/08 2016

v4.4.0

4.4.0.0

HTMLMin Is A Simple HTML Minifier For Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

26/04 2016

v4.3.0

4.3.0.0

HTMLMin Is A Simple HTML Minifier For Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

30/01 2016

v4.2.1

4.2.1.0

HTMLMin Is A Simple HTML Minifier For Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

14/11 2015

v4.2.0

4.2.0.0

HTMLMin Is A Simple HTML Minifier For Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

06/10 2015

v4.1.0

4.1.0.0

HTMLMin Is A Simple HTML Minifier For Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

03/08 2015

v4.0.1

4.0.1.0

HTMLMin Is A Simple HTML Minifier For Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

26/06 2015

v4.0.0

4.0.0.0

HTMLMin Is A Simple HTML Minifier For Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

21/05 2015

v3.1.0

3.1.0.0

HTMLMin Is A Simple HTML Minifier For Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

10/03 2015

v3.0.1

3.0.1.0

HTMLMin Is A Simple HTML Minifier For Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

05/02 2015

v3.0.0

3.0.0.0

HTMLMin Is A Simple HTML Minifier For Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

04/01 2015

v2.1.4

2.1.4.0

HTMLMin Is A Simple HTML Minifier For Laravel 4.2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

05/10 2014

v2.1.3

2.1.3.0

HTMLMin Is A Simple HTML Minifier For Laravel 4.2

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

12/08 2014

v2.1.2

2.1.2.0

HTMLMin Is A Simple HTML Minifier For Laravel 4.2+

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

09/08 2014

v2.1.1

2.1.1.0

HTMLMin Is A Simple HTML Minifier For Laravel 4.2+

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

02/08 2014

v2.1.0

2.1.0.0

HTMLMin Is A Simple HTML Minifier For Laravel 4.2+

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

20/07 2014

v2.0.0

2.0.0.0

HTMLMin Is A Simple HTML Minifier For Laravel 4.2+

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

16/07 2014

v2.0.0-RC1

2.0.0.0-RC1

HTMLMin Is A Simple HTML Minifier For Laravel 4.2+

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

30/04 2014

v1.1.1

1.1.1.0

HTMLMin Is A Simple HTML Minifier For Laravel 4.1

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

21/04 2014

v1.1.0

1.1.0.0

HTMLMin Is A Simple HTML Minifier For Laravel 4.1

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

12/02 2014

v1.0.0

1.0.0.0

HTMLMin Is A Simple HTML Minifier For Laravel 4.1

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

10/02 2014

v1.0.0-RC2

1.0.0.0-RC2

HTMLMin Is A Simple HTML Minifier For Laravel 4.1

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

08/02 2014

v1.0.0-RC1

1.0.0.0-RC1

HTMLMin Is A Simple HTML Minifier For Laravel 4.1

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

21/01 2014

v1.0.0-beta1

1.0.0.0-beta1

HTMLMin Is A Simple HTML Minifier For Laravel 4.1

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

12/12 2013

v0.3.1-alpha

0.3.1.0-alpha

HTMLMin Is A Simple HTML Minifier For Laravel 4

  Sources   Download

Apache License 2.0

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

10/12 2013

v0.3.0-alpha

0.3.0.0-alpha

HTMLMin Is A Simple HTML Minifier For Laravel 4

  Sources   Download

Apache License 2.0

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

25/08 2013

v0.2.0-alpha

0.2.0.0-alpha

HTMLMin Is A Simple HTML Minifier For Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin

15/08 2013

v0.1.0-alpha

0.1.0.0-alpha

HTMLMin Is A Simple HTML Minifier For Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Graham Campbell

laravel framework html minifier htmlmin graham campbell grahamcampbell html minifier laravel htmlmin laravel-htmlmin