Illuminate\Database\Eloquent\Model::registerModelEvent PHP Method

registerModelEvent() protected static method

Register a model event with the dispatcher.
protected static registerModelEvent ( string $event, Closure | string $callback, integer $priority ) : void
$event string
$callback Closure | string
$priority integer
return void
    protected static function registerModelEvent($event, $callback, $priority = 0)
    {
        if (isset(static::$dispatcher)) {
            $name = static::class;
            static::$dispatcher->listen("eloquent.{$event}: {$name}", $callback, $priority);
        }
    }
Model