PHPackages                             plank/laravel-hush - 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. [Framework](/categories/framework)
4. /
5. plank/laravel-hush

ActiveLibrary[Framework](/categories/framework)

plank/laravel-hush
==================

A targeted version of the Laravel Frameworks withoutEvents method.

v13.1.3(1mo ago)111.1k↑22.2%[4 PRs](https://github.com/plank/laravel-hush/pulls)2MITPHPPHP ^8.3CI passing

Since Oct 25Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/plank/laravel-hush)[ Packagist](https://packagist.org/packages/plank/laravel-hush)[ Docs](https://github.com/plank/laravel-hush)[ RSS](/packages/plank-laravel-hush/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (16)Versions (23)Used By (2)

[![](art/hush.png)](https://plank.co)

[![PHP Version Support](https://camo.githubusercontent.com/c018469f03428980db6d9be1be0e95976f68d81bb174133c37b7ac132159b5fc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f706c616e6b2f6c61726176656c2d687573683f636f6c6f723d253233666165333730266c6162656c3d706870266c6f676f3d706870266c6f676f436f6c6f723d253233666666)](https://packagist.org/packages/plank/laravel-hush)[![GitHub Workflow Status](https://camo.githubusercontent.com/1159a2849abe6c2248c77e4ce8ea6b10674ffe1d04335e26c1cd4343a79501ef/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706c616e6b2f6c61726176656c2d687573682f72756e2d74657374732e796d6c3f6272616e63683d6d61696e2626636f6c6f723d253233626663396264266c6162656c3d72756e2d7465737473266c6f676f3d676974687562266c6f676f436f6c6f723d253233666666)](https://github.com/plank/laravel-hush/actions?query=workflow%3Arun-tests)[![](https://camo.githubusercontent.com/61949892af5944c6c268814d2240ac3e562b571e6fde463a0c00a39ab69ede67/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f636f7665726167652f706c616e6b2f6c61726176656c2d687573683f636f6c6f723d253233666639333736266c6162656c3d74657374253230636f766572616765266c6f676f3d636f64652d636c696d617465266c6f676f436f6c6f723d253233666666)](https://codeclimate.com/github/plank/laravel-hush/test_coverage)[![](https://camo.githubusercontent.com/895bc15efffd7f62da9d18d8cc81a486cb99b26a4e42bf2259d98d9f67bf3941/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792f706c616e6b2f6c61726176656c2d687573683f636f6c6f723d253233353238636666266c6162656c3d6d61696e7461696e61626c696c697479266c6f676f3d636f64652d636c696d617465266c6f676f436f6c6f723d253233666666)](https://codeclimate.com/github/plank/laravel-hush/maintainability)

Laravel Hush
============

[](#laravel-hush)

laravel-hush is a Laravel package that allows you to disable the observers and handlers for model events during the execution of a passed in closure. It functions as a more targetted version of the `withoutEvents()` method that ships with Laravel.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
    - [withoutObserver(string $observer, Closure $callback)](#withoutobserverstring-observer-closure-callback)
    - [withoutObservers(array $observers, Closure $callback)](#withoutobserversarray-observers-closure-callback)
    - [withoutHandler(string $event, Closure $callback, array $classes = \[\])](#withouthandlerstring-event-closure-callback-array-classes)
    - [withoutHandlers(array $events, Closure $callback, array $classes = \[\])](#withouthandlersarray-events-closure-callback-array-classes)
- [Credits](#credits)
- [License](#license)
- [Security Vulnerabilities](#security-vulnerabilities)

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

[](#installation)

You can install the package via composer:

```
composer require plank/laravel-hush
```

Usage
-----

[](#usage)

The package ships with one trait: `HushesHandlers`

To enable the functionality on a model, simply include the trait on it.

It implements four methods:

### withoutObserver(string $observer, Closure $callback)

[](#withoutobserverstring-observer-closure-callback)

This method will disable any handlers in the provided class for all of the models observable events during the exection of the callback.

Example assuming `User` uses `HushesHandlers`. In this example no handlers from the entire `UserObserver` class will be called during the execution of the callback, for any observable event.

```
User::withoutObserver(UserObserver::class, function () {
    User::create(['name' => 'John Doe']);
});
```

### withoutObservers(array $observers, Closure $callback)

[](#withoutobserversarray-observers-closure-callback)

This method is the same as `withoutObserver()` but allows you to pass in an array of observer classes to disable.

For example:

```
User::withoutObservers([UserObserver::class, ExpirableObserver::class], function () {
    User::create(['name' => 'John Doe']);
});
```

### withoutHandler(string $event, Closure $callback, array $classes = \[\])

[](#withouthandlerstring-event-closure-callback-array-classes--)

This method will disable handlers for the provided event during the execution of the callback.

When no classes are provided, it will disable all handlers for the event.

When classes are provided (including classes where handlers have been added statically) it will only disable the registered handlers which are from the provided classes.

In the following example all `created` event handlers would be disabled, however if there were `creating` handlers registered for example, those event handlers would still run.

```
User::withoutHandler('created', function () {
    User::create(['name' => 'John Doe']);
});
```

In the following example all `created` event handlers defined in the `User` model would be disabled, however if there was a `created` handler in a `UserObserver` class (or anywhere else), it would still handle the event.

```
User::withoutHandler('created', function () {
    User::create(['name' => 'John Doe']);
}, [User::class]);
```

### withoutHandlers(array $events, Closure $callback, array $classes = \[\])

[](#withouthandlersarray-events-closure-callback-array-classes--)

This method is the same as `withoutHandler()` but allows you to pass in an array of events to disable handlers for.

Credits
-------

[](#credits)

- [Kurt Friars](https://github.com/kfriars)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability within siren, please send an e-mail to . All security vulnerabilities will be promptly addressed.

Check Us Out!
-------------

[](#check-us-out)

[ ![](https://camo.githubusercontent.com/039eee1ba9a2d1d596a7717543932e2bd5408ba5057f3dd50a8558729ce93235/68747470733a2f2f706c616e6b2e636f2f6f70656e2d736f757263652f62616e6e6572)](https://plank.co/open-source/learn-more-image)Plank focuses on impactful solutions that deliver engaging experiences to our clients and their users. We're committed to innovation, inclusivity, and sustainability in the digital space. [Learn more](https://plank.co/open-source/learn-more-link) about our mission to improve the web.

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance80

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 56.3% 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 ~44 days

Recently: every ~0 days

Total

21

Last Release

57d ago

Major Versions

v9.1.0 → v10.1.12025-01-31

v10.1.1 → v11.1.12025-01-31

v10.1.0 → v12.1.12025-03-12

10.x-dev → v11.1.22025-12-16

v11.1.2 → v13.1.32026-03-23

PHP version history (3 changes)v1.0.0PHP ^8.1

v12.1.1PHP ^8.2

v13.1.3PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/108450?v=4)[Plank](/maintainers/Plank)[@plank](https://github.com/plank)

---

Top Contributors

[![kfriars](https://avatars.githubusercontent.com/u/3378675?v=4)](https://github.com/kfriars "kfriars (9 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelplanklaravel-hush

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/plank-laravel-hush/health.svg)

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

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.1k84.2M225](/packages/laravel-horizon)[lunarstorm/laravel-ddd

A Laravel toolkit for Domain Driven Design patterns

17959.0k](/packages/lunarstorm-laravel-ddd)[bezhansalleh/filament-plugin-essentials

A collection of essential traits that streamline Filament plugin development by taking care of the boilerplate, so you can focus on shipping real features faster

27584.7k16](/packages/bezhansalleh-filament-plugin-essentials)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[jonpurvis/squeaky

A Laravel Validation Rule to Help Catch Profanity.

706.0k](/packages/jonpurvis-squeaky)[blendbyte/filament-title-with-slug

TitleWithSlugInput - Easy Permalink Slugs for the FilamentPHP Form Builder (PHP / Laravel / Livewire)

1322.4k3](/packages/blendbyte-filament-title-with-slug)

PHPackages © 2026

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