public function brandUpdateSave() { $validation_rule = array('brand_name' => array('required', 'max:100'), 'brand_description' => array('required', 'max:500')); $validation = Validator::make(Input::all(), $validation_rule); if ($validation->fails()) { // If validation failed then returned to the serviseForm with error massege $brand_id = Input::get('brand_id'); return Redirect::to('/editBrand/' . $brand_id)->withErrors($validation); } else { $brand_name = Input::get('brand_name'); $brand_description = Input::get('brand_description'); $brand_id = Input::get('brand_id'); // Insert data into database ItemConfiguration::UpdateBrand($brand_id, $brand_name, $brand_description); return Redirect::to('/addBrand')->with('add_success_massege', 'Brand Updated successfully.'); } }