public function postOperasionalCabang()
 {
     $search = Request::get('cab');
     if ($search == 0) {
         return $this->getIndex();
     }
     $cabang = \App\cabang::find($search);
     $this->title = $this->title . ' - ' . $cabang->nama;
     $operasional = byoperasional::where('idcab', $search)->get();
     return view('admin.report.operasional')->withInput(Request::all())->with('list', $operasional)->with('title', $this->title);
 }
 public function cabangEdit($id)
 {
     $cabang = cabang::find($id);
     if (Request::method() == 'POST') {
         $v = Validator::make(Request::all(), ['nama' => 'required', 'alamat' => 'required', 'telp' => 'max:15']);
         if ($v->fails()) {
             return redirect()->back()->withInput()->withErrors($v->errors());
         }
         $cabang->nama = Request::get('nama');
         $cabang->alamat = Request::get('alamat');
         $cabang->telp = Request::get('telp');
         $cabang->save();
         return Redirect::to('/cabang');
     }
     return view('pages.cabang-edit')->with('cabang', $cabang);
 }