protected function _remove() { try { if (!($id = $this->input->post('id'))) { Alert::once('success', 'Invalid ID!', Url::current()); } $user = new BrandModel($id); $user->remove(); $partner = new Partner(UserSession::get('user._id')); $partner->remove_brand($id); Alert::once('success', 'Brand removed successfully!', Url::current()); } catch (\Exception $e) { Alert::once('error', $e->getMessage(), Url::current()); } }