New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

blessing/filter

Filters API for designing plugin system.
5,463

Larablocks Analysis

blessing/filter works with Laravel 6 to 11 (latest release v1.4.0, Jun 29, 2025), all past end of life (the last on Mar 12, 2026): no more fixes, even for security.

Recommendation checks

Use with care

Use with care: meets 0 of 4 checks.

  • Supports only Laravel 6 to 11, past end of life since Mar 12, 2026
  • No release in the last 12 months (last: Jun 29, 2025)
  • 421 downloads a month (needs 10,000)
  • 0 GitHub stars (needs 100)

State

Quiet
  • Last stable release: Jun 29, 2025.
  • No releases in the last 12 months.
  • First released: Dec 27, 2019.
  • Monthly downloads: 421.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.

Install
composer require blessing/filter
Latest Version:v1.4.0
Laravel:6 – 11
License:MIT
Last Updated:Jun 29, 2025
Links: GitHub  ·  Packagist
Maintainer: gplane

filters

Filters API for designing and creating plugin system, within Laravel.

We used this in Blessing Skin Server.

The "Filters API" is similar with Filters API of WordPress, but comes with different API. And this package is designed for Laravel, so it may not work if you use it without Laravel.

💿 Install

Run Composer:

composer require blessing/filter

🔨 Usage

With Laravel's Auto-Discovery, you don't need to configure your Laravel application manually.

Currently this package doesn't provide Facade. You must get instance by using type-hint in your controllers or using global resolve() helper function.

For example:

use Blessing\Filter;

class MyController extends Controller
{
    public function home(Filter $filter)
    {
        //
    }
}

Add a filter

To add a filter for a specified hook, just call the add method:

$filter->add('hook_name', function ($value) {
    return $value;
});

Note that the filter handler must return a value; otherwise, the value after applied will be null.

You also can pass a class which has a public method called filter as handler.

class MyFilter
{
    public function filter($value)
    {
        return $value;
    }
}

$filter->add('hook_name', MyFilter::class);
// or
$filter->add('hook_name', 'MyFilter');

The class will be resolved from Laravel's service container, so you can use type-hint at the constructor of your class to resolve dependencies.

Additionally, you can specify the priority for your filter handler. Higher integer value indicates that it should come with higher priority.

Default priority is 20.

$filter->add('hook_name', function ($value) {
    return $value;
}, 30);  // Higher than default priority.

Apply a hook

You can call apply method to apply a hook:

$value = $filter->apply('hook_name', 'hi');

Then, the second argument you passed will be manipulated by filters.

Also, you can pass additional arguments as an array:

$value = $filter->apply('hook_name', 'hi', [$arg1, $arg2]);

Those additional arguments won't be manipulated by filters.

Remove all filters

To remove all filters for a specified hook, just:

$filter->remove('hook_name');

Totally...

This is a full example:

$filter->add('hook_name', function ($value, $arg1, $arg2) {
    if ($arg1 === '...') {
        return $value;
    }

    return $value.'!';
});

$value = $filter->apply('hook_name', 'hi', ['abc', 'def']);
// You should get the text "hi!" here.

📄 License

MIT License (c) The Blessing Skin Team

Related Packages

josh-taylor/sage-svg

WordPress package to enable a blade directive to use SVG images inline with Sage...

46,862 18
snapwp/snap-core

Core files for Snap

6,134 4
jjgrainger/posttypes

Simple WordPress custom post types.

682,032 371
paulbunyannet/wordpress-artisan

Artisan commands to interact with Wordpress

21,504 0
voceconnect/voce-post-meta

Easily create post metaboxes and add fields

20,141 6

Version History

Version Released Laravel License
v1.4.0 ^6 || ^7 || ^8 || ^9 || ^10 || ^11 MIT
v1.3.0 ^6 || ^7 || ^8 || ^9 || ^10 MIT
v1.2.0 ^6 || ^7 || ^8 MIT
v1.1.1 6.* || 7.* MIT
v1.1.0 6.* || 7.* MIT