![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/ledger.corals.io/Corals/core/Foundation/Traits/Cache/ |
<?php namespace Corals\Foundation\Traits\Cache; trait PivotEventTrait { use ExtendBelongsToManyTrait, ExtendFireModelEventTrait; public static function pivotAttaching($callback, $priority = 0) { static::registerModelEvent('pivotAttaching', $callback, $priority); } public static function pivotAttached($callback, $priority = 0) { static::registerModelEvent('pivotAttached', $callback, $priority); } public static function pivotDetaching($callback, $priority = 0) { static::registerModelEvent('pivotDetaching', $callback, $priority); } public static function pivotDetached($callback, $priority = 0) { static::registerModelEvent('pivotDetached', $callback, $priority); } public static function pivotUpdating($callback, $priority = 0) { static::registerModelEvent('pivotUpdating', $callback, $priority); } public static function pivotUpdated($callback, $priority = 0) { static::registerModelEvent('pivotUpdated', $callback, $priority); } /** * Get the observable event names. * * @return array */ public function getObservableEvents() { return array_merge( [ 'creating', 'created', 'updating', 'updated', 'deleting', 'deleted', 'saving', 'saved', 'restoring', 'restored', 'pivotAttaching', 'pivotAttached', 'pivotDetaching', 'pivotDetached', 'pivotUpdating', 'pivotUpdated', ], $this->observables ); } }