/** * Display a listing of the resource. * * @return Response */ public function indexUsuarios($id = null) { if ($id == null) { $data['usuarios'] = User::with('Perfil')->orderBy('id', 'asc')->get(); $data['perfiles'] = Perfil::orderBy('id', 'asc')->get(); return $data; } else { return $this->show($id); } }