public function deleteAssociation() { /** @var Idea $idea1 */ $idea1 = Idea::find($this->request->get('idea1')); /** @var Idea $idea2 */ $idea2 = Idea::find($this->request->get('idea2')); if (!$idea1 || !$idea2) { throw new NotFoundHttpException(); } $relationship = IdeaRelationship::findRelationship($idea1, $idea2); if ($relationship) { $relationship->delete(); } return redirect()->action('IdeaController@view', ['id' => $idea1->id]); }