示例#1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\RackRequest $request)
 {
     //
     $data = $request->except('_token');
     Rack::create($data);
     return back();
 }
示例#2
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);
 }
示例#3
0
 public function rack($id)
 {
     Rack::find($id)->delete();
     return back();
 }