Download the PHP package langemike/laravel5-less without Composer
On this page you can find all versions of the php package langemike/laravel5-less. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel5-less
LESS support for Laravel 5.x without Node.js
Use LESS with your Laravel installation. Uses oyejorge/less.php instead of leafo/lessphp which is a more actively developed port of the official LESS processor.
Features
- Can modify LESS variables on-the-fly
- Can parse custom CSS/LESS and append it to the resulting file
- Works with Twitter Bootstrap v3.3.5 (thanks to oyejorge/less.php)
- Caching support
Installation
First, pull in the package through Composer.
Note: The following installation instructions are longer required with Laravel 5.5.
If using Laravel 5 up to 5.4, include the service provider within config/app.php
.
In the aliases section, add:
Configuration
In order to work with the configuration file, you're best off publishing a copy with Artisan:
` This will create a config file 'less.php' in your config directory.
Settings
You can specify your configuration through 3 options: .env
, config.php
file and through $options
parameter.
Your .env configuration will be used by default, it will be overridden by it's config.php settings, but the $options parameter will have the highest preference.
Recompilation
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.
- change -- Check if LESS file(s) are modified. If it does, recompile CSS
- none -- Don't check, don't recompile.
- always -- Always rewrite CSS
Usage
Within your models or controllers, you can perform modification to the outputted CSS. Here are some examples: before you perform a redirect...
Within your view you can use the Less::url()
function to link to your generated CSS
Passing true
as the second parameter to Less::url()
will auto-detect, based on your configuration, if recompilation is needed and will do so accordingly.
Credits
This project is inspired by Less4Laravel. Without the hard work of oyejorge/less.php this project wouldn't be possible.