hedronium/spaceless-blade

Adds the @spaceless tag to Blade. (works like in Twig)
655,683 31
Install
composer require hedronium/spaceless-blade
Latest Version:v3.0.0
License:MIT
Last Updated:Mar 28, 2020
Links: GitHub  ·  Packagist
Maintainer: hedronium

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

Example Output:

<div><strong>foo</strong></div>

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

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

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

Related Packages

atriakit/themes

Laravel 5 package providing multi-theme inherited cascading support for views an...

17 0
mindtwo/laravel-blade-spaceless

Blade @spaceless directive that strips whitespace between HTML tags at render ti...

36,440 2
helmut/forms

A customisable and testable form abstraction library.

19 0
mikimaine/themes

Laravel 5 package providing multi-theme inherited cascading support for views an...

10 0
fitztrev/laravel-html-minify

Minifies the HTML output of Laravel 4 applications

214,922 415