コード例 #1
0
ファイル: Comment.php プロジェクト: vegax87/Strimoid
 public function delete()
 {
     foreach ($this->replies as $reply) {
         $reply->delete();
     }
     Content::where('id', $this->content_id)->decrement('comments_count');
     return parent::delete();
 }
コード例 #2
0
ファイル: Entry.php プロジェクト: vegax87/Strimoid
 public function delete()
 {
     foreach ($this->replies as $reply) {
         $reply->delete();
     }
     $this->notifications()->delete();
     return parent::delete();
 }
コード例 #3
0
ファイル: Content.php プロジェクト: strimoid/strimoid
 public function __construct($attributes = [])
 {
     static::deleted(function (Content $content) {
         Notification::where('content_id', $this->getKey())->delete();
         if (!$content->trashed()) {
             foreach ($this->comments() as $comment) {
                 $comment->delete();
             }
         }
     });
     parent::__construct($attributes);
 }
コード例 #4
0
ファイル: Group.php プロジェクト: vegax87/Strimoid
 public function delete()
 {
     $this->deleteAvatar();
     $this->deleteStyle();
     return parent::delete();
 }
コード例 #5
0
ファイル: ContentRelated.php プロジェクト: vegax87/Strimoid
 public function delete()
 {
     Content::where('id', $this->content_id)->decrement('related_count');
     return parent::delete();
 }