Beispiel #1
0
 public function edit(EditLayerRequest $request)
 {
     $na = $request->na ? $request->na : 'Y';
     $layer = Layer::find($request->id);
     $layer->layername = $request->layername;
     $layer->layerurl = $request->layerurl;
     $layer->layer = $request->layer;
     $layer->na = $na;
     //$layer->leveluser = $request->leveluser;
     $layer->grafik = $request->grafik;
     $layer->id_grouplayer = $request->id_grouplayer;
     $layer->orderlayer = $request->orderlayer;
     $layer->tipelayer = $request->tipelayer;
     $layer->featureaccess = $request->featureaccess;
     $layer->visible = $request->visible;
     $layer->option_visible = (bool) $request->option_visible;
     $layer->option_opacity = $request->option_opacity;
     $layer->jsonfield = $request->jsonfield;
     $layer->save();
     $layer->touch();
     try {
         $_rolelayer = $this->getlevel($layer->id_layer);
         $usermodul = DB::table('role_layer')->where('layer_id', $layer->id_layer)->delete();
         foreach ($_rolelayer as $key => $value) {
             $detil = new RoleLayer();
             $detil->role_id = $value['role_id'];
             $detil->layer_id = $value['layer_id'];
             $detil->save();
         }
     } catch (Exception $e) {
         DB::rollback();
         throw $e;
     }
     return redirect('layer/manage-existing-layer/edit/' . $request->id . '/success');
 }
 public function edit(EditLayerRequest $request)
 {
     $na = $request->na ? $request->na : 'Y';
     $layer = Layer::find($request->id);
     $layer->layername = $request->layername;
     $layer->layerurl = $request->layerurl;
     $layer->layer = $request->layer;
     $layer->na = $na;
     $layer->orderlayer = $request->orderlayer;
     $layer->tipelayer = $request->tipelayer;
     $layer->featureaccess = $request->featureaccess;
     $layer->visible = $request->visible;
     $layer->option_visible = (bool) $request->option_visible;
     $layer->option_opacity = $request->option_opacity;
     $layer->jsonfield = $request->jsonfield;
     $layer->save();
     $layer->touch();
     try {
         if ($request->level != null) {
             $_rolelayer = $this->getlevel($layer->id_layer);
             $usermodul = DB::table('role_layer')->where('layer_id', $layer->id_layer)->delete();
             foreach ($_rolelayer as $key => $value) {
                 $detil = new RoleLayer();
                 $detil->role_id = $value['role_id'];
                 $detil->layer_id = $value['layer_id'];
                 $detil->save();
             }
         }
     } catch (Exception $e) {
         DB::rollback();
         throw $e;
     }
     return Redirect::to('layer')->with('message', \AHelper::format_message('Data Berhasil diubah', 'info'));
 }