예제 #1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     //
     if ($request->has('company_id')) {
         $company_id = $request['company_id'];
         session(["layout_company_id" => $company_id]);
     } else {
         if ($request->session()->has('layout_company_id')) {
             $company_id = $request->session()->get('layout_company_id');
         } else {
             $company_id = 2;
         }
     }
     $racks = Rack::with(['company', 'networkDevice'])->where('company_id', $company_id)->get();
     return view('racklayouts.index')->with('racks', $racks);
 }
예제 #2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $racks = Rack::with('company')->get();
     return view('rack.index')->with('racks', $racks);
 }