reinvanoyen/middlewares-minifier

There is no license information available for the latest version (dev-master) of this package.

dev-master 2020-05-04 19:31 UTC

This package is auto-updated.

Last update: 2024-04-05 04:08:26 UTC


README

Install

composer require reinvanoyen/middlewares-minifier

Oak-framework specific installation

This package provides a Service Provider specifically for the Oak framework. This does NOT mean you can't use it with any other framework. As long as the framework respects PSR-15, this package can be used.

1) Register the Service provider

<?php

$app->register([
    \ReinVanOyen\Middlewares\HtmlMinifier\HtmlMinifierServiceProvider::class,
]);

2) Register the middleware

<?php

$router->middleware('default', [
    \ReinVanOyen\Middlewares\HtmlMinifier\HtmlMinifierMiddleware::class,
]);

3) Bind the middleware group to a route

<?php

$router->get('(?<slug>.*)', PagesController::class, 'view')
    ->middleware(['default',])
;