PHPackages                             jboysen/laravel-gcc - 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. jboysen/laravel-gcc

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

jboysen/laravel-gcc
===================

Use Google Closure Compiler to minify javascript files in Laravel 4.

v1.2.5(12y ago)23511MITPHPPHP &gt;=5.3.0

Since Sep 5Pushed 12y ago2 watchersCompare

[ Source](https://github.com/jboysen/laravel-gcc)[ Packagist](https://packagist.org/packages/jboysen/laravel-gcc)[ RSS](/packages/jboysen-laravel-gcc/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (9)Dependencies (4)Versions (10)Used By (0)

Laravel4 Google Closure Compiler
================================

[](#laravel4-google-closure-compiler)

This Laravel4 package adds a view-helper `javascript_compiled()` to minimize a single javascript file or bundles of several javascript files. Everything is done using [Google Closure Compiler](https://developers.google.com/closure/compiler/).

[![Latest Stable Version](https://camo.githubusercontent.com/6c8c98249fe8febb41c835d9f7760527dfd630f234ec1b8ed55749e660792694/68747470733a2f2f706f7365722e707567782e6f72672f6a626f7973656e2f6c61726176656c2d6763632f762f737461626c652e706e67)](https://packagist.org/packages/jboysen/laravel-gcc)[![Total Downloads](https://camo.githubusercontent.com/29fb0279be7efddf0d73abc11fed79a5b1fb813bd81ddf6ef506ab9442ebbda4/68747470733a2f2f706f7365722e707567782e6f72672f6a626f7973656e2f6c61726176656c2d6763632f646f776e6c6f6164732e706e67)](https://packagist.org/packages/jboysen/laravel-gcc)[![Build Status](https://camo.githubusercontent.com/9211149a5fbfa6c9d00f063049a1dbd9255f969a107bc5770aa274a8f90a62c4/68747470733a2f2f7472617669732d63692e6f72672f6a626f7973656e2f6c61726176656c2d6763632e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/jboysen/laravel-gcc)[![Coverage Status](https://camo.githubusercontent.com/e8cf84cbba40c53b7bb68e21961f3bf27e5938ff8a39587c72eb78c0023497ce/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6a626f7973656e2f6c61726176656c2d6763632f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/jboysen/laravel-gcc?branch=master)

Installation
------------

[](#installation)

Install it via Composer by adding the following to your `composer.json`-file (the asterix can be changed to an exact version):

```
"jboysen/laravel-gcc": "1.*"

```

NOTE: *if you get this error: `zendframework/zend-http dev-master requires zendframework/zend-stdlib dev-master -> no matching package found.`, you might have got this [error](https://github.com/composer/composer/issues/2218)..*

...and add the following to the `providers`-array in your `app/config/app.php`:

```
'Jboysen\LaravelGcc\LaravelGccServiceProvider',

```

Configuration
-------------

[](#configuration)

The config-file is self-explanatory: [`config.php`](https://github.com/jboysen/laravel-gcc/blob/master/src/config/config.php)

To change some of the settings, simply just run (as always) `php artisan config:publish jboysen/laravel-gcc`

Usage
-----

[](#usage)

### View helper

[](#view-helper)

The helper accepts either a string representing a single javascript file or an array representing several files (a bundle). A bundle will be compiled in the order given in the array.

Example #1:

```
// hello.blade.php
...
{{ javascript_compiled('default.js') }}

```

Example #2:

```
// hello.php
...

```

This helper will:

1. Lookup the files given as argument to the helper.
2. Create a unique filename for the compiled files based on the filenames and the last modification time of the files.
3. Compile the bundle (if it's not present).
4. Output a script-tag linking to the compiled file.

### artisan commands

[](#artisan-commands)

#### `gcc:build`

[](#gccbuild)

As compilation of several files sometimes can take time, it is better to do this "offline", that is before any users hit the web application.

```
php artisan gcc:build

```

This command will scan all files in the `/app/views`-directory and find all uses of the view-helper described above, and compile the bundles immediately, making sure the users won't experience any long response times.

#### `gcc:clean`

[](#gccclean)

Remove all files from the `/app/storage/laravel-gcc`-folder. This task might be useful in deployment-procedures.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 95.1% 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.

###  Release Activity

Cadence

Every ~12 days

Recently: every ~21 days

Total

9

Last Release

4582d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/935849?v=4)[Jakob Jakobsen Boysen](/maintainers/jboysen)[@jboysen](https://github.com/jboysen)

---

Top Contributors

[![jboysen](https://avatars.githubusercontent.com/u/935849?v=4)](https://github.com/jboysen "jboysen (39 commits)")[![berendiwema](https://avatars.githubusercontent.com/u/196687?v=4)](https://github.com/berendiwema "berendiwema (1 commits)")[![valorin](https://avatars.githubusercontent.com/u/897369?v=4)](https://github.com/valorin "valorin (1 commits)")

---

Tags

laravelminifyclosurecompiler

### Embed Badge

![Health badge](/badges/jboysen-laravel-gcc/health.svg)

```
[![Health](https://phpackages.com/badges/jboysen-laravel-gcc/health.svg)](https://phpackages.com/packages/jboysen-laravel-gcc)
```

###  Alternatives

[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k9.6k1](/packages/vinkius-labs-laravel-page-speed)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90128.1k](/packages/emargareten-inertia-modal)[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

3614.9k](/packages/linkxtr-laravel-qrcode)[wearepixel/laravel-cart

A cart implementation for Laravel

1355.6k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

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