public function loadPollOptions($poll_id) { $poll = PollsDemand::with('details')->with(['votes' => function ($q) use($poll_id) { $q->where('user_id', \Auth::user()->id); $q->where('polls_demand_id', $poll_id); }])->findOrFail($poll_id); return response()->json(['success' => true, 'data' => $poll]); }