Hedronium / SpacelessBlade by hedronium

Adds the @spaceless tag to Blade. (works like in Twig)
511,324
32
7
Package Data
Maintainer Username: hedronium
Maintainer Contact: o.jamal97@gmail.com (Omran Jamal)
Package Create Date: 2015-07-19
Package Last Update: 2020-03-28
Home Page: https://packagist.org/packages/hedronium/spaceless-blade
Language: PHP
License: MIT
Last Refreshed: 2024-04-17 15:12:09
Package Statistics
Total Downloads: 511,324
Monthly Downloads: 5,489
Daily Downloads: 318
Total Stars: 32
Total Watchers: 7
Total Forks: 4
Total Open Issues: 1

SpacelessBlade

Latest Stable Version License Total Downloads

Adds a @spaceless tag to Laravel's Blade templating engine.

In twig you could do:

{% spaceless %}
    <div>
        <strong>foo</strong>
    </div>
{% endspaceless %}

Do you miss Twig's {% spaceless %} tag while working with Laravel's Blade?

With this package you can do this in Laravel's Blade too (without using Twig, of course). Example:

@spaceless
    <div>
        <strong>foo</strong>
    </div>
@endspaceless

Installation

Get the Package

For Laravel 5.1 or above, get version 2, by adding the following lines to composer.json

"hedronium/spaceless-blade": "~2.0"

For Laravel 4 or above, get version 1 with latest patches, by adding the following lines to composer.json

"hedronium/spaceless-blade": "~1.0"

Register the Service Provider

open up your app.php in your config folder, and add the following line to your providers list like:

'providers' => array(
    ...
    'hedronium\SpacelessBlade\SpacelessBladeProvider'
)