astroshippers / laravel-minified-blade
This package provides `.min.blade.php` file extension
v1.0.1
2022-06-16 00:53 UTC
Requires
- php: ^8.0.2
- illuminate/support: ^9.17
- illuminate/view: ^9.17
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.8
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
This package is not auto-updated.
Last update: 2024-11-01 10:31:48 UTC
README
Laravel Minified Blade
This package provides .min.blade.php
file extension.
Just add the .min
to your .blade.php
, and the template will get minified! ⚡
Installation
composer require astroshippers/laravel-minified-blade
Usage
Let's use this file as an example.
<div> @if($age > 13) <p> Welcome to your new account! </p> @else <b> Sorry, access denied. </b> @endif </div>
Normally, without using this package it will be compiled into this:
<div> <?php if($age > 13): ?> <p> Welcome to your new account! </p> <?php else: ?> <b> Sorry, access denied. </b> <?php endif; ?> </div> <?php /**PATH /home/asdf/code/notionmailer/resources/views/test.blade.php ENDPATH**/ ?>
But, if you add this package and use .min
in your file extension, you will have the following result:
<div><?php if($age> 13): ?><p> Welcome to your new account! </p><?php else: ?><b> Sorry, access denied. </b><?php endif; ?></div><?php /**PATH /home/asdf/code/notionmailer/resources/views/test.min.blade.php ENDPATH**/ ?>
What is the use case?
Why not just use a directive, such as @minified
and @endminified
?
Directives get executed after the template is rendered, which may add unwanted behavior such as your dynamic content spacing being minified.