/**
  * Show all industries with the new one on top
  *
  * @return Response
  */
 public function index()
 {
     //$industries = Industry::latest()->get();
     $industries = Industry::all();
     return view('industries.index', compact('industries'));
     //return response()->json($industries);
 }
 /**
  * List all industries
  * @return Response
  */
 public function index()
 {
     try {
         if (!($user = JWTAuth::parseToken()->authenticate())) {
             return response()->json(['user_not_found'], 404);
         }
     } catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $e) {
         return response()->json(['token_expired'], $e->getStatusCode());
     } catch (Tymon\JWTAuth\Exceptions\TokenInvalidException $e) {
         return response()->json(['token_invalid'], $e->getStatusCode());
     } catch (Tymon\JWTAuth\Exceptions\JWTException $e) {
         return response()->json(['token_absent'], $e->getStatusCode());
     }
     // the token is valid and we have found the user via the sub claim
     //$industry = Industry::latest()->get();
     $industries = Industry::all();
     return response()->json(compact('industries'));
 }
Example #3
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     if (Auth::user()->identifier == 3) {
         $title = 'dataUpdate';
         $roles = Role::lists('name', 'id');
         $rolesShow = Role::all();
         $functionalAreas = FunctionalAreas::lists('name', 'id');
         $faShow = FunctionalAreas::all();
         $industry = Industry::lists('name', 'id');
         $industryShow = Industry::all();
         $skills = Skills::lists('name', 'id');
         $indfunctionalMapping = Industry_functional_area_mappings::leftJoin('industries', 'industry_functional_area_mappings.industry', '=', 'industries.id')->leftJoin('functional_areas', 'industry_functional_area_mappings.functional_area', '=', 'functional_areas.id')->get([DB::raw('concat(industries.name, " - ", functional_areas.name) as name'), 'industry_functional_area_mappings.id as id'])->lists('name', 'id');
         $industryfareaShow = Industry_functional_area_mappings::leftJoin('industries', 'industry_functional_area_mappings.industry', '=', 'industries.id')->leftJoin('functional_areas', 'industry_functional_area_mappings.functional_area', '=', 'functional_areas.id')->get(['industries.name as name', 'functional_areas.name as fareaname', 'industry_functional_area_mappings.id']);
         // $indfunctional = Industry_functional_area_mappings::leftJoin('industries', 'industry_functional_area_mappings.industry', '=', 'industries.id')
         // 														 ->leftJoin('functional_areas', 'industry_functional_area_mappings.functional_area', '=', 'functional_areas.id')
         // 														 ->get([DB::raw('concat(industries.name, " - ", functional_areas.name) as name'), 'industry_functional_area_mappings.id as id']);
         // $industryfarearoleShow = Industry_functional_area_role_mapping::leftJoin('roles', 'industry_functional_area_role_mapping.role', '=', 'roles.id')
         // 															  ->get(['roles.name as name', $indfunctional]);
         return view('pages.adminUpdate', compact('title', 'skills', 'roles', 'functionalAreas', 'industry', 'indfunctionalMapping', 'rolesShow', 'faShow', 'industryShow', 'industryfareaShow', 'industryfarearoleShow'));
         // return $indfunctionalMapping;
     } else {
         return redirect('/home');
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     $industries = Industry::all();
     return view('industries.index', compact('industries'));
 }