PHPackages                             messagebooster/laravel-sass - 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. messagebooster/laravel-sass

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

messagebooster/laravel-sass
===========================

Compiles your SASS .scss files to .css every time you run your app (in development)

07PHP

Since Aug 24Pushed 11y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

laravel-sass
============

[](#laravel-sass)

Automatic SASS-to-CSS compiling for Laravel 4 (and any other framework by the way) while being in development. Every time you run your app (hitting index.php) laravel-sass will automatically compile all .scss files in your scss folder to .css files in your css folder. Support latest version of SASS (scss syntax) and mixins. Boom!

Installation &amp; Usage
------------------------

[](#installation--usage)

Add this to your composer.json, please note that this is a **require-dev**, not a normal **require**. This devides real dependencies from ones you only need for local development.

```
"require-dev": {
    "panique/laravel-sass": "dev-master"
}
```

Add this line into your `public/index.php` in Laravel, right **before** `$app->run();`.

```
SassCompiler::run("scss/", "css/");
```

The first parameter is the relative path to your scss folder (create one) and the second parameter is the relative path to your css folder. Usually it totally makes sense to create those folders in the public folder. Make sure PHP can write into the css folder by giving the folder `sudo chmod -R 777 public/css` (when being in /var/www). **Note:** 777 is just for development, in a production server there's no need to give that folder any write-rights.

Install or update your Composer dependencies to add laravel-sass by doing `composer install` or `composer update`. Composer automatically installs everything in require-dev by default.

**IMPORTANT:** When you later deploy your application and don't want to install the require-dev stuff, then do `composer install --no-dev` (or `composer update --no-dev`).

Optional feature
----------------

[](#optional-feature)

There's an optional third parameter for `SassCompiler::run()` that expects one of the strings explained on [http://leafo.net/scssphp/docs/#output\_formatting](http://leafo.net/scssphp/docs/#output_formatting). This defines the desired output. `scss_formatter` is the standard laravel-sass uses, choose `scss_formatter_compressed` if you need a minimized css file. `scss_formatter_nested` is for nested output, optimized for readability.

Testing
-------

[](#testing)

To test if everything works okay, simply add this to the head of `app/views/hello.php`: `` and put a file called style.scss in your scss folder. Now run the app and play around with the (s)css rules in your style.scss, after each refresh you should see the changes instantly!

How @import works
-----------------

[](#how-import-works)

The `@import` of sass rules from other files works now perfectly. Make sure to import the files like it should be: If the file is called \_colors.scss and is in the basic scss folder:

```
@import 'colors';

```

If the file is called \_colors.scss and is in the subfolder `modules` of the basic scss folder:

```
@import 'modules/colors';

```

Read the official docs for more.

When deploying ...
------------------

[](#when-deploying-)

.. then make sure you comment out this line again: `SassCompiler::run("scss/", "css/");`. Future releases of this tool will have a development/production switch/recognizer.

Used scripts
------------

[](#used-scripts)

This tool uses the excellent [scssphp SASS compiler](http://leafo.net/scssphp/). scssphp supports the latest SCSS syntax (3.2.12).

Other projects
--------------

[](#other-projects)

-
-
-
-
- My blog DEV METAL:

License
-------

[](#license)

Licensed under [MIT](http://www.opensource.org/licenses/mit-license.php). Totally free for private or commercial projects.

Support / Donate
----------------

[](#support--donate)

If you think this script is useful, then think about supporting the project:

1. Rent your next server at [A2 Hosting](http://www.a2hosting.com/4471.html) or [DigitalOcean](https://www.digitalocean.com/?refcode=40d978532a20).
2. Donate via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=P5YLUK4MW3LDG)or [GitTip](https://www.gittip.com/Panique/)or [Flattr](https://flattr.com/submit/auto?user_id=panique&url=https%3A%2F%2Fgithub.com%2Fpanique%2Flaravel-sass)
3. Contribute to this project.

Hire me
-------

[](#hire-me)

I'm available for freelance work. Remote worldwide or locally around Central Europe. Mail me if you like, the address can be found easily.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.1% 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.

### Community

Maintainers

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

---

Top Contributors

[![panique](https://avatars.githubusercontent.com/u/156321?v=4)](https://github.com/panique "panique (27 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")[![MessageBooster](https://avatars.githubusercontent.com/u/8695709?v=4)](https://github.com/MessageBooster "MessageBooster (1 commits)")

### Embed Badge

![Health badge](/badges/messagebooster-laravel-sass/health.svg)

```
[![Health](https://phpackages.com/badges/messagebooster-laravel-sass/health.svg)](https://phpackages.com/packages/messagebooster-laravel-sass)
```

###  Alternatives

[infection/include-interceptor

Stream Wrapper: Include Interceptor. Allows to replace included (autoloaded) file with another one.

3124.2M5](/packages/infection-include-interceptor)[jeroen/rewindable-generator

Provides a simple adapter to make generators rewindable

1655.4k1](/packages/jeroen-rewindable-generator)

PHPackages © 2026

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