{"id":27354133,"url":"https://github.com/nckg/laravel-minify-html","last_synced_at":"2025-04-12T21:53:42.717Z","repository":{"id":54716580,"uuid":"69222841","full_name":"nckg/laravel-minify-html","owner":"nckg","description":"Very, very simple HTML minifier with Laravel support","archived":false,"fork":false,"pushed_at":"2021-02-02T18:32:31.000Z","size":20,"stargazers_count":14,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-09-17T15:28:48.803Z","etag":null,"topics":["html-minifier","laravel","middleware","minifier","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nckg.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-26T07:08:04.000Z","updated_at":"2022-02-20T05:21:00.000Z","dependencies_parsed_at":"2022-08-14T00:40:48.871Z","dependency_job_id":null,"html_url":"https://github.com/nckg/laravel-minify-html","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nckg%2Flaravel-minify-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nckg%2Flaravel-minify-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nckg%2Flaravel-minify-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nckg%2Flaravel-minify-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nckg","download_url":"https://codeload.github.com/nckg/laravel-minify-html/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637826,"owners_count":21137538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html-minifier","laravel","middleware","minifier","php"],"created_at":"2025-04-12T21:53:41.971Z","updated_at":"2025-04-12T21:53:42.692Z","avatar_url":"https://github.com/nckg.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTML minifier\n[![Build Status](https://travis-ci.org/nckg/laravel-minify-html.svg?branch=master)](https://travis-ci.org/nckg/laravel-minify-html) [![Packagist](https://img.shields.io/packagist/v/nckg/laravel-minify-html.svg?maxAge=2592000?style=flat-square)](https://github.com/nckg/laravel-minify-html) [![Packagist](https://img.shields.io/packagist/dt/nckg/laravel-minify-html.svg?maxAge=2592000?style=flat-square)](https://github.com/nckg/laravel-minify-html) [![codecov](https://codecov.io/gh/nckg/laravel-minify-html/branch/master/graph/badge.svg)](https://codecov.io/gh/nckg/laravel-minify-html)\n\n## Introduction\n\nVery, very simple html minifier with Laravel 5.x support.\n\nIt _minifies_ HTML by\n\n1. removing HTML comments except IE conditions\n2. removing comments\n3. shorten multiple white spaces\n4. removing whitespaces between HTML tags\n5. collapsing new lines\n \nYou should end up with a small size profit:\n\n| Uniminfied | Minified |\n|------------|----------|\n| 64.2KB     | 44.6KB   |\n\n## Code Samples\n\n```php\n$input = \"\u003ca href=\"/foo\" class=\"bar  moo        \"\u003eHello World\u003c/a\u003e\";\n$minifier = new Minifier();\n$output = $minifier-\u003ehtml($string); // \u003ca href=\"/foo\" class=\"bar moo \"\u003eHello World\u003c/a\u003e\n```\n\n## Installation\n\nYou can install the package via composer:\n\n``` bash\ncomposer require nckg/laravel-minify-html\n```\nIf you are using Laravel you can add the middleware to your middleware providers\n\n```php\n// app/Http/Kernel.php\n/**\n * The application's global HTTP middleware stack.\n *\n * @var array\n */\nprotected $middleware = [\n    ...\n    \\Nckg\\Minify\\Middleware\\MinifyResponse::class,\n];\n```\n\n## Testing\n\n``` bash\ncomposer test\n```\n\n## License\n\nThe MIT License (MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnckg%2Flaravel-minify-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnckg%2Flaravel-minify-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnckg%2Flaravel-minify-html/lists"}