/** * Display a listing of the resource. * * @return Response */ public function index() { $response = new stdClass(); $statusCode = 200; $authId = Auth::user()->id; if ($authId) { $cid = UserChurch::where(array('uid' => $authId))->pluck('cid'); $response = Church::find($cid); } else { $statusCode = 403; } return Response::json($response, $statusCode); }