/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { session_start(); if (!isset($_SESSION['AUTH']) || $_SESSION['AUTH'] == false) { \App::abort(500, 'User not authenticated'); } $i = instanceUser::with('instance')->get(); return response()->json($i); }