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

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

saritasa/blade-directives
=========================

Saritasa custom blade directives

1.0.4(8y ago)38.6kMITPHPPHP &gt;=5.5.9

Since Mar 28Pushed 5y ago8 watchersCompare

[ Source](https://github.com/Saritasa/php-blade-directives)[ Packagist](https://packagist.org/packages/saritasa/blade-directives)[ RSS](/packages/saritasa-blade-directives/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

PHP Blade Directives
====================

[](#php-blade-directives)

[![PHP CodeSniffer](https://github.com/Saritasa/php-blade-directives/workflows/PHP%20Codesniffer/badge.svg)](https://github.com/Saritasa/php-blade-directives/actions)[![Release](https://camo.githubusercontent.com/348f25d529e8212b7c0b7d94e5d022b15223834bea5b1458ccd857a215d4bde5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f73617269746173612f7068702d626c6164652d646972656374697665732e737667)](https://github.com/Saritasa/php-blade-directives/releases)[![PHPv](https://camo.githubusercontent.com/513b0f70079a236e06678a1b0934e121c00db94a44f95fe2a7943f99473f3a2f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73617269746173612f626c6164652d646972656374697665732e737667)](http://www.php.net)[![Downloads](https://camo.githubusercontent.com/ca72f0953a49fbc9122f4bb754f562c70230f962c2c407346fcf7b4bf335b0f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73617269746173612f626c6164652d646972656374697665732e737667)](https://packagist.org/packages/saritasa/blade-directives)

Custom Blade directives for Laravel Applications.

See

Laravel 5.x
-----------

[](#laravel-5x)

Install the `saritasa/blade-directives` package:

```
$ composer require saritasa/blade-directives
```

If you use Laravel 5.4 or less, or 5.5+ with [package discovery](https://laravel.com/docs/5.5/packages#package-discovery) disabled, add the BladeDirectivesServiceProvider service provider `config/app.php`:

```
'providers' => array(
    // ...
    Saritasa\Laravel\BladeDirectivesServiceProvider::class,
)
```

Available directives
--------------------

[](#available-directives)

### @activeIfRoute(routeName)

[](#activeifrouteroutename)

Output word 'active' if URL, requested by user, matches provided route name

**Example**:

```

    Settings

```

### @selectedIf(expression)

[](#selectedifexpression)

Output word 'selected' if passed expression evaluates to true

**Example**:

```

    @foreach($users as $user)
        id == $currentUserId)>{{ $user->name }}
    @endforeach

```

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

[](#contributing)

1. Create fork, checkout it
2. Develop locally as usual. **Code must follow [PSR-1](http://www.php-fig.org/psr/psr-1/), [PSR-2](http://www.php-fig.org/psr/psr-2/)** - run [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) to ensure, that code follows style guides
3. Update [README.md](README.md) to describe new or changed functionality
4. Add changes description to [CHANGES.md](CHANGES.md) file. Use [Semantic Versioning](https://semver.org/) convention to determine next version number.
5. When ready, create pull request

### Make shortcuts

[](#make-shortcuts)

If you have [GNU Make](https://www.gnu.org/software/make/) installed, you can use following shortcuts:

- `make cs` (instead of `php vendor/bin/phpcs`) - run static code analysis with [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)to check code style
- `make csfix` (instead of `php vendor/bin/phpcbf`) - fix code style violations with [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)automatically, where possible (ex. PSR-2 code formatting violations)
- `make install` - instead of `composer install`
- `make all` or just `make` without parameters - invokes described above **install**, **cs** tasks sequentially - project will be assembled and checked with linter with one single command

Resources
---------

[](#resources)

- [Bug Tracker](http://github.com/saritasa/php-blade-directives/issues)
- [Code](http://github.com/saritasa/php-blade-directives)
- [Changes History](CHANGES.md)
- [Authors](http://github.com/saritasa/php-blade-directives/contributors)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 85.2% 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 ~74 days

Total

5

Last Release

3035d ago

### Community

Maintainers

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

---

Top Contributors

[![populov](https://avatars.githubusercontent.com/u/3766033?v=4)](https://github.com/populov "populov (23 commits)")[![hollow-en](https://avatars.githubusercontent.com/u/87475798?v=4)](https://github.com/hollow-en "hollow-en (2 commits)")[![maxermolenko](https://avatars.githubusercontent.com/u/11438109?v=4)](https://github.com/maxermolenko "maxermolenko (2 commits)")

---

Tags

blade-directivesphplaravelblade

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[robsontenorio/mary

Gorgeous UI components for Livewire powered by daisyUI and Tailwind

1.5k454.7k15](/packages/robsontenorio-mary)[stijnvanouplines/blade-country-flags

A package to easily make use of country flags in your Laravel Blade views.

26307.2k6](/packages/stijnvanouplines-blade-country-flags)[technikermathe/blade-lucide-icons

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

18299.2k7](/packages/technikermathe-blade-lucide-icons)[saade/blade-iconsax

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

21138.5k](/packages/saade-blade-iconsax)[mckenziearts/blade-untitledui-icons

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

16104.9k5](/packages/mckenziearts-blade-untitledui-icons)[afatmustafa/blade-hugeicons

A package to easily make use of Hugeicons(Free version) in your Laravel Blade views.

13129.0k3](/packages/afatmustafa-blade-hugeicons)

PHPackages © 2026

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