reportsOf()->delete(); // update refcounts $rev = $self->revision; $rev->decrement('refs'); // Delete the revision if it has no other refs (manually, to update row refs) if ($rev->refs <= 0) $rev->delete(); }); } /** Authoring user */ public function author() { return $this->belongsTo(User::class, 'author_id'); } /** Target revision */ public function revision() { return $this->belongsTo(Revision::class); } /** Target table (that this was submitted to) */ public function table() { return $this->belongsTo(Table::class); } }