PHP code example of laravelless / lessphp

1. Go to this page and download the library: Download laravelless/lessphp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

laravelless / lessphp example snippets


    'providers' => [
        ...,
        Laravelless\Lessphp\LessphpServiceProvider::class,
    ];
    /**********/
    'aliases' => [
        ...,
        'Lessphp'   => Laravelless\Lessphp\LessphpFacade::class,
    ];

    return array(
        'css_path'          => base_path('css'),
        'less_path'         => base_path('less'),
        'cache_extension'   => '.cache',
        'formatter'         => "compressed",
    );

    $filename = 'style.less';
    $less = \Lessphp::compile($filename);

    $filename = 'style.less';
    $less = \Lessphp::cacheCompile($filename);

    $less = \Lessphp::cacheCompile($filename,'style-min');

    $data = [
                'myBorderRadius'=>'5px',
            ];
    $less = \Lessphp::setVariables($data)->compile($filename);
sh
$ php artisan vendor:publish