PHPackages                             jtgrimes/less4laravel - 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. jtgrimes/less4laravel

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

jtgrimes/less4laravel
=====================

Bringing lessphp into Laravel

1.2.0(10y ago)183.4k4MITPHPPHP &gt;=5.4.0

Since Jan 17Pushed 10y ago4 watchersCompare

[ Source](https://github.com/jtgrimes/less4laravel)[ Packagist](https://packagist.org/packages/jtgrimes/less4laravel)[ RSS](/packages/jtgrimes-less4laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (19)Used By (0)

Less4Laravel
============

[](#less4laravel)

Allows you to use [Less](http://lesscss.org//) in [Laravel 5](http://laravel.com/) with no fuss, no muss.

---

If you're still using Laravel 4, please lock your composer version to `'~0.3'`. Check out the [README\_L4.md](README_L4.md) file for more Laravel 4 instructions
----------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#if-youre-still-using-laravel-4-please-lock-your-composer-version-to-03-check-out-the--readme_l4md-file-for-more-laravel-4-instructions)

---

License
=======

[](#license)

Less4Laravel is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT), the same license Laravel uses.

Installation
============

[](#installation)

Via Composer

```
$ composer require jtgrimes\less4laravel

```

Once Composer has installed or updated your packages, you need to register Less4Laravel with Laravel itself. Open up `/config/app.php` and find the providers key towards the bottom and add:

```
'Jtgrimes\Less4laravel\LessServiceProvider'

```

In the aliases section, add:

```
'Less'	=>	'Jtgrimes\Less4laravel\LessFacade'

```

Configuration
=============

[](#configuration)

In order to work with the configuration file, you're best off publishing a copy with Artisan:

```
$ php artisan vendor:publish

```

The defaults are:

- Recompile whenever any .less file is updated.
- Cache .less files in `/storage/framework/cache`
- Store .less files in `resources/assets/less`
- Store generated .css files in `public/css`
- Link to `/css/filename.css`
- Don't minify the generated css file

All of these defaults can be changed in `/app/config/less4laravel.php`.

Additionally you can (and probably should) have different configurations for development and production. Specifically, you probably don't want to be generating css files on your production server, since it will slow down your site.

In order to have different configs on your development and production servers, you'll do something like this:

Open up less4laravel.config and change

```
	'compile_frequency' => 'changed',

```

to

```
    'compile_frequency' => env('LESS4LARAVEL_FREQUENCY'),

```

You can use any environment variable name you want -- L4L\_FREQ is an example.

In your local `.env` file, add

```
    'LESS4LARAVEL_FREQUENCY' => 'changed',

```

and in your production `.env` file, add

```
    'LESS4LARAVEL_FREQUENCY' => 'never'

```

Usage
=====

[](#usage)

In your view file, just call `Less::to('file')` to compile the .less file (if needed) and generate a link to the output css file.

If you're using Laravel Blade, be sure to un-escape your call to Less:

```
	{!! Less::to('file') !!}

```

To add properties to your link, just put them in an array as the second variable to the `to` function: `Less::to('filename', ['media'=>'print'])` will generate ``

You can also use the `Less::link()` function if you don't want Less4Laravel generating your html:

```

```

Credits
=======

[](#credits)

Less4Laravel doesn't exist without Leaf Corcoran's [lessphp](http://leafo.net/lessphp/).
lessphp doesn't exist without [LESS](http://lesscss.org/). Less4Laravel also requires Taylor Otwell's [Laravel](http://laravel.com/) framework. The readme is largely boosted from Rob Crowe's readme for (the very awesome) [TwigBridge](https://github.com/rcrowe/TwigBridge).

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% 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 ~66 days

Recently: every ~44 days

Total

15

Last Release

3943d ago

Major Versions

0.3.0 → 1.0.02015-02-04

PHP version history (2 changes)0.1.0PHP &gt;=5.3.0

1.0.0PHP &gt;=5.4.0

### Community

Maintainers

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

---

Top Contributors

[![jtgrimes](https://avatars.githubusercontent.com/u/3291952?v=4)](https://github.com/jtgrimes "jtgrimes (20 commits)")[![pafnuty](https://avatars.githubusercontent.com/u/1635679?v=4)](https://github.com/pafnuty "pafnuty (3 commits)")[![spamoom](https://avatars.githubusercontent.com/u/99203?v=4)](https://github.com/spamoom "spamoom (1 commits)")

---

Tags

laravelless

### Embed Badge

![Health badge](/badges/jtgrimes-less4laravel/health.svg)

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

###  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)[zizaco/lessy

Lessy is a simple and lean LESS compiler for Laravel

2116.7k](/packages/zizaco-lessy)[efficiently/larasset

Larasset is a library for Laravel 5 which manage assets in an easy way.

684.8k](/packages/efficiently-larasset)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[caouecs/sirtrevorjs

Sir Trevor JS in Laravel project

5421.6k](/packages/caouecs-sirtrevorjs)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)

PHPackages © 2026

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