Пример #1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(Request $request)
 {
     //// Validate the request...
     ServerModel::where('uuid', $request->uuid)->update(['instansi_id' => $request->instansi_id, 'name' => $request->name, 'address' => $request->address]);
     return redirect("/server");
 }
Пример #2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit(Request $request)
 {
     $uuid = $request->uuid;
     $user = $request->user();
     $role_id = $request->user()->role_id;
     $instansi_id = $request->user()->instansi_id;
     // Tampilkan data API
     $apis = ApiModel::where('uuid', $uuid)->get();
     if ($role_id <= 2) {
         // Tampilkan semua data Server
         $server_options = ServerModel::all();
     } else {
         $instansi_id = $request->user()->instansi_id;
         // Tampilkan data Server hanya miliknya
         $server_options = ServerModel::where('instansi_id', $instansi_id)->get();
     }
     //Tampilkan Form yang terisi data
     return view('sibankum.admin.apisFormEdit', ['apis' => $apis, 'server_options' => $server_options, 'user' => $user]);
 }