Registry / orm / sofa-hookable

sofa-hookable

JSON →
library7.0.1phppackagistunverified

Laravel Eloquent hooks system, allowing you to attach callbacks to model events.

composer require sofa/hookable
INSTALL
IMPORT
SIG · SOFA-HOOKABLE
S
sofa-hookable
ormphpv7.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Hookable
use Sofa\Hookable\Hookable;

Add a hook to a Laravel Eloquent model that transforms the name before creation.

use Sofa\Hookable\Hookable; class User extends \Illuminate\Database\Eloquent\Model { use Hookable; } User::hook('creating', function ($user) { $user->name = strtoupper($user->name); });
Debug
Known issues

No known issues recorded.

Upgrade
Version history
7.0.1latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
41 hits · last 30 days
node
36
Resources
sofa-hookable — pip install sofa-hookable · libregistry