コード例 #1
0
 public function tambahjabatan()
 {
     $id = isset($_GET['id']) ? $_GET['id'] : 0;
     $edit = jabatan::find($id);
     return view('admin.jabatan', compact('edit'));
 }
 public function jabatanEdit($id)
 {
     $jabatan = jabatan::find($id);
     if (Request::method() == 'POST') {
         $v = Validator::make(Request::all(), ['nama' => 'required']);
         if ($v->fails()) {
             return redirect()->back()->withInput()->withErrors($v->errors());
         }
         $jabatan->nmjabatan = Request::get('nama');
         $jabatan->save();
         return Redirect::to('/jabatan');
     }
     return view('pages.jabatan-edit')->with('jabatan', $jabatan);
 }