A simple Laravel 4 service provider for including the HTMLPurifier for Laravel 4.
The HTMLPurifier Service Provider can be installed via Composer by requiring the
mews/purifier
package and setting the minimum-stability
to dev
(required for Laravel 4) in your
project's composer.json
.
{
"require": {
"laravel/framework": "4.0.*",
"mews/purifier": "dev-master"
},
"minimum-stability": "dev"
}
Update your packages with composer update
or install with composer install
.
To use the HTMLPurifier Service Provider, you must register the provider when bootstrapping your Laravel application. There are essentially two ways to do this.
Find the providers
key in app/config/app.php
and register the HTMLPurifier Service Provider.
'providers' => array(
// ...
'Mews\Purifier\PurifierServiceProvider',
)
Find the aliases
key in app/config/app.php
.
'aliases' => array(
// ...
'Purifier' => 'Mews\Purifier\Facades\Purifier',
)
Purifier::clean(Input::get('inputname'));
^_^