PHPackages                             theanh/laravel-hooks - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. theanh/laravel-hooks

Abandoned → [tadcms/hooks](/?search=tadcms%2Fhooks)Library[Utility &amp; Helpers](/categories/utility)

theanh/laravel-hooks
====================

Add Actions and filters in Laravel like WordPress.

2.0.3(7mo ago)318MITPHPPHP &gt;=8.0

Since Feb 16Pushed 7mo ago2 watchersCompare

[ Source](https://github.com/juzaweb/hooks)[ Packagist](https://packagist.org/packages/theanh/laravel-hooks)[ RSS](/packages/theanh-laravel-hooks/feed)WikiDiscussions master Synced yesterday

READMEChangelog (9)Dependencies (4)Versions (9)Used By (0)

About
-----

[](#about)

Add Actions and filters in Laravel like WordPress.

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

[](#installation)

- Install using Composer

```
composer require juzaweb/hooks

```

Usage
-----

[](#usage)

Anywhere in your code you can create a new action like so:

```
do_action($tag, ...$args)

```

```
 * Do action hook
 * @param string $tag Action / Hook name (E.x: my.hook)
 * @param mixed ...$args Additional parameters to pass to the callback functions.
 * @return void

```

Add action To listen to your hooks, you attach listeners. These are best added to your `AppServiceProvider boot()` method.

```
add_action($tag, $callback, $priority = 20, $arguments = 1)

```

```
 * Add action to hook
 * @param string $tag The name of the filter to hook the $function_to_add callback to.
 * @param callable $callback The callback to be run when the filter is applied.
 * @param int $priority Optional. Used to specify the order in which the functions
 *                                  associated with a particular action are executed.
 *                                  Lower numbers correspond with earlier execution,
 *                                  and functions with the same priority are executed
 *                                  in the order in which they were added to the action. Default 20.
 * @param int $arguments Optional. The number of arguments the function accepts. Default 1.
 * @return void

```

Apply filters

```
apply_filters($tag, $value, ...$args)

```

```
 * Apply filters to value
 * @param string $tag The name of the filter hook.
 * @param mixed  $value The value to filter.
 * @param mixed  ...$args Additional parameters to pass to the callback functions.
 * @return mixed The filtered value after all hooked functions are applied to it.

```

Add filters To listen to your hooks, you attach listeners. These are best added to your `AppServiceProvider boot()` method.

```
add_filters($tag, $callback, $priority = 20, $arguments = 1)

```

```
  * @param string $tag The name of the filter to hook the $function_to_add callback to.
  * @param callable $callback The callback to be run when the filter is applied.
  * @param int $priority Optional. Used to specify the order in which the functions
  *                                  associated with a particular action are executed.
  *                                  Lower numbers correspond with earlier execution,
  *                                  and functions with the same priority are executed
  *                                  in the order in which they were added to the action. Default 20.
  * @param int $arguments   Optional. The number of arguments the function accepts. Default 1.
  * @return bool

```

Using in Blade
--------------

[](#using-in-blade)

Adding the same action as the one in the action example above:

```
@do_action('my.hook', $user)

```

Adding the same filter as the one in the filter example above:

```
You are @apply_filters('my.hook', 'awesome')

```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance64

Regular maintenance activity

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

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 ~241 days

Recently: every ~402 days

Total

8

Last Release

219d ago

Major Versions

v1.0.4 → 2.0.02025-05-24

PHP version history (2 changes)v1.0PHP &gt;=7.0

2.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3169e8a8781068840e9300a57785089da521287dbe0279fc9cc7e8de1c1d95a9?d=identicon)[juzaweb](/maintainers/juzaweb)

---

Top Contributors

[![juzaweb](https://avatars.githubusercontent.com/u/47020363?v=4)](https://github.com/juzaweb "juzaweb (21 commits)")

---

Tags

hooks-for-laravelhooks-laravel-like-wordpresslaravellaravel-hookslaravel-packagesLaravel hookshooks laravelhooks laravel like wordpresshooks for laravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/theanh-laravel-hooks/health.svg)

```
[![Health](https://phpackages.com/badges/theanh-laravel-hooks/health.svg)](https://phpackages.com/packages/theanh-laravel-hooks)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)[mrmarchone/laravel-auto-crud

Laravel Auto CRUD helps you streamline development and save time.

28711.8k2](/packages/mrmarchone-laravel-auto-crud)

PHPackages © 2026

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