blood72 / blade-minify
Minify blade format for personal use
v1.4.1
2021-06-23 12:50 UTC
Requires
- php: >=7.1
- mrclay/minify: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
- phpunit/phpunit: ^8.5
Suggests
- mrclay/minify: This is the parent project of this unofficial package.
README
Blade Minifier for personal use
Obviously this doesn't minify the .blade.php format itself.
This is specialized minification in the compiled .php by the Laravel Blade Compiler.
Index
Requirement
- PHP >= 7.1
- mrclay/minify ^3.0
Installation
Install using the composer.
composer require blood72/blade-minify
Usage
-
simple run
use Blood72\Minify\Blade as BladeMinifier; $minified = BladeMinifier::minify('<HTML string>');
-
with CSS, JavaScript Minifier (its installed by default with this package)
use Blood72\Minify\Blade as BladeMinifier; use JSMin\JSMin as JSMinifier; use Minify_CSSmin as CSSMinifier; $minified = BladeMinifier::minify('<HTML string>', [ 'cssMinifier' => [CSSMinifier::class, 'minify'], 'jsMinifier' => [JSMinifier::class, 'minify'], ]);
Example
You can compare test files. see more examples.
Reference
- Steve Clay's minify
License
This package is open-sourced software licensed under the MIT license.