public function blogcatEdit($id) { if (Request::isMethod('post')) { $data = Input::except(array('_token')); DB::table('blogcategories')->where('id', $id)->update($data); Session::flash('message', 'The Blog category has been updated successfully.'); Session::flash('alert-class', 'alert-success'); return Redirect::to('admin/blogcat/edit/' . $id); } $blogcatData = Blogs::findblogcatdata($id); foreach ($blogcatData as $bdata) { $blogcat = $bdata; } return View::make('admin.blogcatEdit')->with('blogcat', $blogcat); }