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 2d 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

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

4536d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1404903754f1263ec781192b2e850f0a414e319b96897ff633e2a3954124896c?d=identicon)[jboysen](/maintainers/jboysen)

---

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

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k5.4k1](/packages/vinkius-labs-laravel-page-speed)[goszowski/laravel-vendor-minify

A vendor minify package, to remove tests and documentation and minifing all php files to save space

803.6k](/packages/goszowski-laravel-vendor-minify)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[fisharebest/laravel-assets

Asset management for Laravel

208.1k](/packages/fisharebest-laravel-assets)

PHPackages © 2026

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