public function brandSave() { $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 return Redirect::to('/addBrand')->withErrors($validation); } else { $brand_name = Input::get('brand_name'); $brand_description = Input::get('brand_description'); // Insert data into database ItemConfiguration::addBrand($brand_name, $brand_description); return Redirect::to('/addBrand')->with('add_success_massege', 'New Brand Added successfully.'); } }