/** * Cleanup AlbumImage */ public function beforeDelete() { $cover = $this->cover; if ($cover != null) { $cover->delete(); } foreach ($this->getImages() as $image) { $image->delete(); } /** * Remove notifications. */ Notification::remove('Album', $this->id); return parent::beforeDelete(); }
/** * Before Delete, remove LikeCount (Cache) of target object. * Remove activity */ protected function beforeDelete() { Notification::remove('Post', $this->id); return parent::beforeDelete(); }
public function beforeDelete() { foreach ($this->revisions as $revision) { $revision->delete(); } return parent::beforeDelete(); }