PHPackages                             kallbuloso/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. kallbuloso/laravel-blade-directives

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

kallbuloso/laravel-blade-directives
===================================

My Blade directives

v1.0.4(6y ago)0352MITPHPCI failing

Since Apr 10Pushed 6y ago1 watchersCompare

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

READMEChangelogDependencies (5)Versions (6)Used By (2)

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

[](#laravel-blade-directives)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f0816a37b8138ee423e8aaa12a4a38b5df3984c66e74a670ae8cfcf6f4fc095b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b616c6c62756c6f736f2f6c61726176656c2d626c6164652d646972656374697665732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kallbuloso/laravel-blade-directives)[![Total Downloads](https://camo.githubusercontent.com/19b6ff172b49dc6157dbbb4117a73cd8e1d20acce1cd1b8dddcfa837dce122b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b616c6c62756c6f736f2f6c61726176656c2d626c6164652d646972656374697665732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kallbuloso/laravel-blade-directives)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/d2f4bdb264c2027b1980981b5d3eabf19c54d87a5ea9a80bba3d48d56b531dc3/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6b616c6c62756c6f736f2f6c61726176656c2d626c6164652d646972656374697665732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/kallbuloso/laravel-blade-directives)

A collection of nice Laravel Blade directives.

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

[](#installation)

You can install the package via composer:

```
composer require kallbuloso/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, @mdi, @glyph

[](#fa-fas-far-fal-fab-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):
@fas('address-book', 'optional-extra-class')
@far('address-book', 'optional-extra-class')
@fal('address-book', 'optional-extra-class')
@fab('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
```

Testing
-------

[](#testing)

```
composer test
```

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

[](#contributing)

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

About kallbuloso
----------------

[](#about-kallbuloso)

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

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

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

###  Release Activity

Cadence

Every ~93 days

Total

5

Last Release

2266d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9ba8924923a531838253a388934fc8aa9d94b2b540a599bd9836562d1b71868e?d=identicon)[amaralkarl](/maintainers/amaralkarl)

---

Top Contributors

[![kallbuloso](https://avatars.githubusercontent.com/u/4968546?v=4)](https://github.com/kallbuloso "kallbuloso (9 commits)")

---

Tags

laravelbladedirectivesblade-directiveskallbuloso

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[hasinhayder/tyro-dashboard

Tyro Dashboard - Beautiful admin dashboard for managing Tyro roles, privileges, users, and settings

5443.8k](/packages/hasinhayder-tyro-dashboard)[api-platform/laravel

API Platform support for Laravel

58170.4k13](/packages/api-platform-laravel)[hasinhayder/tyro-login

Tyro Login - Beautiful, customizable authentication views for Laravel 12 &amp; 13

2464.9k6](/packages/hasinhayder-tyro-login)[technikermathe/blade-lucide-icons

A package to easily make use of Lucide icons in your Laravel Blade views.

18421.4k11](/packages/technikermathe-blade-lucide-icons)[ublabs/blade-simple-icons

A package to easily make use of Simple Icons in your Laravel Blade views.

1963.4k](/packages/ublabs-blade-simple-icons)

PHPackages © 2026

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