Download the PHP package plank/laravel-hush without Composer

On this page you can find all versions of the php package plank/laravel-hush. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-hush

PHP Version Support GitHub Workflow Status

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

 

Installation

You can install the package via composer:

 

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)

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.

withoutObservers(array $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:

withoutHandler(string $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.

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.

withoutHandlers(array $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

 

License

The MIT License (MIT). Please see License File for more information.

 

Security Vulnerabilities

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

 

Check Us Out!

 

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 about our mission to improve the web.


All versions of laravel-hush with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
spatie/laravel-package-tools Version ^1.14.0
illuminate/contracts Version ^10|^11
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package plank/laravel-hush contains the following files

Loading the files please wait ....