PHPackages                             babounlek/minify - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. babounlek/minify

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

babounlek/minify
================

Package to minify css and javascript script or files

112PHP

Since Aug 29Pushed 8y ago1 watchersCompare

[ Source](https://github.com/babounlek/minify)[ Packagist](https://packagist.org/packages/babounlek/minify)[ RSS](/packages/babounlek-minify/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Minify
======

[](#minify)

Intallation
-----------

[](#intallation)

For installation, add a dependency on babounlek/minify to your composer.json

```
composer require babounlek/minify "dev-master"
```

Usage
-----

[](#usage)

In your app.php,

In providers section add:

```
babounlek\minify\minifyServiceProvider::class,
```

Now in aliases section add:

```
'minify' => babounlek\minify\minify::class,
```

```
use minify;

$min = new minify($source);
$min->setExtension("css");
$result = $min->minify();

or

$min = new minify();
$min->addsource($source);
$min->setExtension("css");
$result = $min->minify();

/*$result is an array containing of tree elements as:
- first is the compressed string
- second is the size of original string
- third is the size of final string
*/

/* $source can be a css or javascript script or url of css or javascript file*/
```

### Sample

[](#sample)

#### input

[](#input)

```
.container-search {
	margin-top: 55px;
	margin-bottom: 10px;
}
```

#### output

[](#output)

```
['.container-search{margin-top:55px;margin-bottom:10px}', 66,56]
```

Try it
------

[](#try-it)

Try it online at:

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a7f7a1e831eb1144e091af5033804f5fb8f06cdf41408f46535529152adfd16d?d=identicon)[babounlek](/maintainers/babounlek)

---

Top Contributors

[![babounlek](https://avatars.githubusercontent.com/u/954008?v=4)](https://github.com/babounlek "babounlek (28 commits)")

---

Tags

laravelminify-cssminify-javascriptphp

### Embed Badge

![Health badge](/badges/babounlek-minify/health.svg)

```
[![Health](https://phpackages.com/badges/babounlek-minify/health.svg)](https://phpackages.com/packages/babounlek-minify)
```

###  Alternatives

[flagstudio/nova-actions-left

Laravel Nova actions on the left

2258.2k](/packages/flagstudio-nova-actions-left)[humanmade/popup

An exit intent popup block that shows when someone may be about to leave the site

144.8k](/packages/humanmade-popup)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
