public function like($likeable) { if ($this->isLiked($likeable)) { throw new \Exception(); } $like = new Like(); $like->user()->associate($this); $likeable->likes()->save($like); return $this; }