PHPackages                             appstract/laravel-blade-directives - 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. [Templating &amp; Views](/categories/templating)
4. /
5. appstract/laravel-blade-directives

ActiveLibrary[Templating &amp; Views](/categories/templating)

appstract/laravel-blade-directives
==================================

Handy Blade directives

1.14.0(2y ago)8501.2M—5.9%74[2 issues](https://github.com/appstract/laravel-blade-directives/issues)[2 PRs](https://github.com/appstract/laravel-blade-directives/pulls)9MITPHPPHP &gt;=7.1.3

Since Jun 2Pushed 2y ago25 watchersCompare

[ Source](https://github.com/appstract/laravel-blade-directives)[ Packagist](https://packagist.org/packages/appstract/laravel-blade-directives)[ Docs](https://github.com/appstract/laravel-blade-directives)[ RSS](/packages/appstract-laravel-blade-directives/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (37)Used By (9)

Laravel Blade Directives
========================

[](#laravel-blade-directives)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3f3980985b86586dfadf5885097556640c09251ff80fe7587cf461aec1fc9e34/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6170707374726163742f6c61726176656c2d626c6164652d646972656374697665732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/appstract/laravel-blade-directives)[![Total Downloads](https://camo.githubusercontent.com/2c5d6481071c29e2f9489c928c59414d264dc87269a5a745d82a1f2854720e54/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6170707374726163742f6c61726176656c2d626c6164652d646972656374697665732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/appstract/laravel-blade-directives)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/298595bb72e0d49d44f2be8fa4953e1d209d1d068f38fbd7867fc6d1e5b3b9f3/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6170707374726163742f6c61726176656c2d626c6164652d646972656374697665732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/appstract/laravel-blade-directives)

A collection of nice Laravel Blade directives.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require appstract/laravel-blade-directives
```

Usage
-----

[](#usage)

### @istrue

[](#istrue)

Only show when `$variable` isset and true.

```
@istrue($variable)
   This will be echoed
@endistrue
```

Or when you would like to quickly echo

```
@istrue($variable, 'This will be echoed')
```

### @isfalse

[](#isfalse)

Same as `@istrue` but checks for isset and false.

```
@isfalse($variable)
   This will be echoed
@endisfalse
```

### @isnull

[](#isnull)

Only show when `$variable` is null.

```
@isnull($variable)
   This will be echoed
@endisnull
```

### @isnotnull

[](#isnotnull)

Same as `@isnull` but one shows when `$variable` is not null.

```
@isnotnull($variable)
   This will be echoed
@endisnotnull
```

### @dump and @dd

[](#dump-and-dd)

```
@dump($var)

@dd($var)
```

### @mix

[](#mix)

Create a HTML element to your Laravel-Mix css or js.

```
@mix('/css/app.css')
@mix('/js/app.js')
```

Output:

```

```

### @style

[](#style)

Create a `` element or `` element with a css path.

```
@style
    body { background: black }
@endstyle

@style('/css/app.css')
```

### @script

[](#script)

Create a `` element with or without a js path.

```
@script
    alert('hello world')
@endscript

@script('/js/app.js')
```

### @inline

[](#inline)

Load the contents of a css or js file inline in your view.

```
@inline('/js/manifest.js')
```

### @pushonce

[](#pushonce)

Same as `@push` but will include content one time only. Useful for repeatable blocks.

First parameter must follow the syntax `stack-name:group-name`.

```
@pushonce('js:foobar')

@endpushonce
```

Include pushes with standard `@stack` directive:

```
@stack('js')
```

### @routeis

[](#routeis)

Checks if the current route name is equal to the given parameter. You can use a wildcard like `blog.post.*`.

```
@routeis('webshop.checkout')
    Do something only on the checkout
@endrouteis
```

### @routeisnot

[](#routeisnot)

Checks if the current route name is not equal to the given parameter. You can use a wildcard like `blog.post.*`

```
@routeisnot('webshop.checkout')
    Do something only if this is not the checkout
@endrouteisnot
```

### @instanceof

[](#instanceof)

Checks if the first parameter is an instance of the second parameter.

```
@instanceof($user, 'App\User')
    User is an instance of App\User
@endinstanceof
```

### @typeof

[](#typeof)

Checks if the parameter is of a certain type.

```
@typeof($text, 'string')
    Text is a string
@endtypeof
```

### @repeat

[](#repeat)

Repeat something a specified amount of times.

```
@repeat(3)
    Iteration #{{ $iteration }}
@endrepeat
```

### @fa, @fas, @far, @fal, @fab, @fad, @mdi, @glyph

[](#fa-fas-far-fal-fab-fad-mdi-glyph)

Quickly output an icon with Font Awesome, Material Design Icons or Glyphicon.

```
@fa('address-book', 'optional-extra-class')

// for Font Awesome 5 (solid, regular, light, brand, duotone):
@fas('address-book', 'optional-extra-class')
@far('address-book', 'optional-extra-class')
@fal('address-book', 'optional-extra-class')
@fab('address-book', 'optional-extra-class')
@fad('address-book', 'optional-extra-class')

// for Material Design Icons
@mdi('account', 'optional-extra-class')

// for Glyphicons
@glyph('glass', 'optional-extra-class')
```

### @data

[](#data)

Output data-attributes from an array.

```
@data(['testing' => 123])
```

### @haserror

[](#haserror)

Quickly output for classical `$errors->has('input_name')` to determine if any error messages exist for a given field.

```
@haserror('input_name')
    This input has an error
@endhaserror
```

### @count

[](#count)

Output number of entries.

```
@count([1,2,3])
```

### @nl2br

[](#nl2br)

Replaces `\n` into ``.

```
@nl2br('foo\n bar\n baz\n')
```

### @snake, @kebab, @camel

[](#snake-kebab-camel)

Output formatted string (uses Laravel Helpers).

```
@snake('fooBar')
// output: 'foo_bar'

@kebab('fooBar')
// output: 'foo-bar'

@camel('foo bar')
// output: 'fooBar'
```

Testing
-------

[](#testing)

```
composer test
```

Contributing
------------

[](#contributing)

Contributions are welcome, [thanks to y'all](https://github.com/appstract/laravel-blade-directives/graphs/contributors) :)

About Appstract
---------------

[](#about-appstract)

Appstract is a small team from The Netherlands. We create (open source) tools for Web Developers and write about related subjects on [Medium](https://medium.com/appstract). You can [follow us on Twitter](https://twitter.com/appstractnl), [buy us a beer](https://www.paypal.me/appstract/10) or [support us on Patreon](https://www.patreon.com/appstract).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity61

Solid adoption and visibility

Community39

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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.

###  Release Activity

Cadence

Every ~62 days

Recently: every ~250 days

Total

36

Last Release

1070d ago

Major Versions

0.7.1 → 1.0.02018-03-26

PHP version history (5 changes)0.1.0PHP ^7.0

0.2.1PHP &gt;=5.6

1.6.0PHP ^7.1.3

1.11.0PHP ^7.1.3|^8.0

1.14.0PHP &gt;=7.1.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1470623?v=4)[Gijs Jorissen](/maintainers/gizburdt)[@gizburdt](https://github.com/gizburdt)

![](https://avatars.githubusercontent.com/u/3015449?v=4)[Olav van Schie](/maintainers/ovanschie)[@ovanschie](https://github.com/ovanschie)

---

Top Contributors

[![gizburdt](https://avatars.githubusercontent.com/u/1470623?v=4)](https://github.com/gizburdt "gizburdt (65 commits)")[![ovanschie](https://avatars.githubusercontent.com/u/3015449?v=4)](https://github.com/ovanschie "ovanschie (39 commits)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (5 commits)")[![roni-estein](https://avatars.githubusercontent.com/u/8517475?v=4)](https://github.com/roni-estein "roni-estein (5 commits)")[![teuunn](https://avatars.githubusercontent.com/u/17406280?v=4)](https://github.com/teuunn "teuunn (5 commits)")[![adriaroca](https://avatars.githubusercontent.com/u/3205030?v=4)](https://github.com/adriaroca "adriaroca (3 commits)")[![bgencacat](https://avatars.githubusercontent.com/u/10961975?v=4)](https://github.com/bgencacat "bgencacat (3 commits)")[![f-liva](https://avatars.githubusercontent.com/u/346224?v=4)](https://github.com/f-liva "f-liva (3 commits)")[![svenluijten](https://avatars.githubusercontent.com/u/11269635?v=4)](https://github.com/svenluijten "svenluijten (3 commits)")[![gboquizosanchez](https://avatars.githubusercontent.com/u/20032391?v=4)](https://github.com/gboquizosanchez "gboquizosanchez (2 commits)")[![Kishdia](https://avatars.githubusercontent.com/u/3230856?v=4)](https://github.com/Kishdia "Kishdia (2 commits)")[![m1guelpf](https://avatars.githubusercontent.com/u/23558090?v=4)](https://github.com/m1guelpf "m1guelpf (2 commits)")[![rennokki](https://avatars.githubusercontent.com/u/21983456?v=4)](https://github.com/rennokki "rennokki (2 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (2 commits)")[![akoepcke](https://avatars.githubusercontent.com/u/5311185?v=4)](https://github.com/akoepcke "akoepcke (1 commits)")[![aziev](https://avatars.githubusercontent.com/u/11891491?v=4)](https://github.com/aziev "aziev (1 commits)")[![serderovsh](https://avatars.githubusercontent.com/u/24723913?v=4)](https://github.com/serderovsh "serderovsh (1 commits)")[![fgilio](https://avatars.githubusercontent.com/u/6857732?v=4)](https://github.com/fgilio "fgilio (1 commits)")[![jornatf](https://avatars.githubusercontent.com/u/92311176?v=4)](https://github.com/jornatf "jornatf (1 commits)")[![breart](https://avatars.githubusercontent.com/u/9466810?v=4)](https://github.com/breart "breart (1 commits)")

---

Tags

bladedirectiveslaravellaravel-packagephpappstractlaravel-blade-directives

### Embed Badge

![Health badge](/badges/appstract-laravel-blade-directives/health.svg)

```
[![Health](https://phpackages.com/badges/appstract-laravel-blade-directives/health.svg)](https://phpackages.com/packages/appstract-laravel-blade-directives)
```

###  Alternatives

[cagilo/cagilo

A set of open-source Blade components for the Laravel Framework

172996.5k](/packages/cagilo-cagilo)[orchid/blade-icons

An easy way inline SVG images in your Blade templates.

223.4M9](/packages/orchid-blade-icons)[wireui/heroicons

The Tailwind Heroicons for laravel blade by WireUI

43390.8k5](/packages/wireui-heroicons)[stillat/antlers-components

2656.0k1](/packages/stillat-antlers-components)[itstructure/laravel-grid-view

Grid view for laravel framework

2546.6k2](/packages/itstructure-laravel-grid-view)[ycs77/inertia-laravel-ssr-head

Simple SSR Head for Inertia Laravel

3211.5k](/packages/ycs77-inertia-laravel-ssr-head)

PHPackages © 2026

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