HTMLMin / Laravel-HTMLMin

A simple HTML minifier for Laravel 5, 6, 7, 8 & 9.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work

BrunoMCTeixeira opened this issue · comments

Laravel 5.6, I've set blade to true and it does nothing

@BrunoMCTeixeira You need to clear the view cache. Just run php artisan view:clear and reload the page to view the minified source.

Thanks, forget to clear the cache :D

I've done what DevFlick says, plus
composer install --optimize-autoloader
php artisan config:cache

But I keep seeing my code like below?
image

Any ideas?

Doesn't work for me either.

I have the same problem, on Laravel 5.2:

config/app.php:

<?php
return [
    //...
    'providers' => [
        //...
        HTMLMin\HTMLMin\HTMLMinServiceProvider::class,
    ],
    'aliases' => [
        //...
        'HTMLMin' => HTMLMin\HTMLMin\Facades\HTMLMin::class,
    ]
];

config/htmlmin.php:

<?php
return [
    //...
    'blade' => TRUE,
];

Commands executed:

php artisan vendor:publish
php artisan view:clear
php artisan config:cache

EDIT

If I turn 'force' => TRUE I get it to minify. I would assume that shouldn't be required, however.

Please add this cache instructions to readme file.

commented

Same here, even after reading the README like 10 times it's totally unclear how to use this lib. Can you please add clear information on how to use ?

@rfpludwick It's important to note that if you have any inline js in your blade file it will not going to be minified without force option. If you however move your inline js code into separate file it's going to work just fine. @rodrigopedra Why there's no such info in readme???

i can't make it work,
i've tried everything .
Blade => true,
Force => true ,
php artisan view:clear
php artisan config:cache

but it doesn't do any changes
EDIT
Apparently changes are only affected when you do a change in your existing blade files

Working but after minifying html java script not working can any one guide me on this.Thanks

commented

tried force and all other recommendations in this thread. Nothing happens.

I must set "force" to true. the html also does not fully minify
image

Same. Nothing happens
BTW I use Lumen 8 and I set "blade", "force" to "true" in the config.

Update: it works. Clear views cache in Lumen using:

rm storage/framework/views/*.php

I just can't use this package.

Tried to set my app_env to prodution, manually remove view cached/compiled files, try to "artisan view:clear" and "config:clear", set blade AND force to true : nothing happens.