Laravel HTMLMin is a simple HTML minifier for Laravel 4.1.
Please check the system requirements before installing Laravel HTMLMin.
To get the latest version of Laravel HTMLMin, simply require it in your composer.json
file.
"graham-campbell/htmlmin": "*"
You'll then need to run composer install
or composer update
to download it and have the autoloader updated.
Once Laravel HTMLMin is installed, you need to register the service provider. Open up app/config/app.php
and add the following to the providers
key.
'GrahamCampbell\HTMLMin\HTMLMinServiceProvider'
You can register the HTMLMin facade in the aliases
key of your app/config/app.php
file if you like.
'HTMLMin' => 'GrahamCampbell\HTMLMin\Facades\HTMLMin'
Laravel HTMLMin supports optional configuration.
To get started, first publish the package config file:
php artisan config:publish graham-campbell/htmlmin
There are two config options:
Automatic Blade Optimizations
This option ('blade'
) enables minification of the 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
.
Automatic Live Optimizations
This option ('live'
) enables minification of the html responses just before they are served. These optimizations have greater impact on php processing time as the optimizations are applied on every request. 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
.
There is currently no usage documentation besides the API Documentation for Laravel HTMLMin.
You may see an example of implementation in Laravel Navigation or CMS Core.
Before submitting a pull request, you should ensure that your fork is up to date.
You may fork Laravel HTMLMin:
git remote add upstream git://github.com/GrahamCampbell/Laravel-HTMLMin.git
The first command is only necessary the first time. If you have issues merging, you will need to get a merge tool such as P4Merge.
You can then update the branch:
git pull --rebase upstream master
git push --force origin <branch_name>
Once it is set up, run git mergetool
. Once all conflicts are fixed, run git rebase --continue
, and git push --force origin <branch_name>
.
Please review these guidelines before submitting any pull requests.
Apache License
Copyright 2013-2014 Graham Campbell
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community