public function chatExists($id) { if (Chat::where('innovation_id', '=', $id)->where('investor_id', '=', \Auth::user()->id)->first() == null) { return 1; } else { return 2; } }