kimcastle/laravel5-lessphp

Bringing lessphp into Laravel
114
Install
composer require kimcastle/laravel5-lessphp
Latest Version:1.1.3
PHP:>=5.5.0
License:MIT
Last Updated:Jun 20, 2017
Links: GitHub  ·  Packagist
Maintainer: kimcastle

laravel5-lessphp

lessphp is a compiler for LESS by PHP

(1) First, pull in the package through Composer.

"require": {
    "kimcastle/laravel5-lessphp": "1.0.0"
}

(2) And then, if using Laravel 5, include the service provider within config/app.php.

'providers' => [
    "Kimcastle\Laravel5Less\LessServiceProvider::class"
];

In the aliases section, add:

'Less' => Kimcastle\Laravel5Less\Facades\Less::class

(3) Uage

Within your models or controllers, you can perform modification to the outputted CSS. Here are some examples:

use Kimcastle\Laravel5Less\Facades\Less;

class TestController extend Controller
{
     public function less()
     {
          Less::modifyVars(['@externalBgColor' => 'red'])->compile('less_test');
          
          Less::modifyVars(['@externalBgColor' => '#ff0001'])->url('less_test', true);
     }
}

Related Packages

hailwood/smartless4laravel

An advanced LESS PHP compiler package for Laravel4 based on the LESSisMore L3 bu...

199
websemantics/lcss2php

Conveniently extracts variable declarations from multiple Less / Scss sources an...

60,177 3
php-tmdb/laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the...

53,303 162
artdarek/oauth-4-laravel

OAuth Service Provider for Laravel 4

517,186 679
oriceon/oauth-5-laravel

OAuth Service Provider for Laravel 5

1,613,315 174