public function removeRoleFeature($rid, $fid) { //find feature role pivot; $feature_role = FeatureRole::whereNull('deleted_at')->where('role_id', $rid)->where('feature_id', $fid)->first(); $feature_role->delete(); return Redirect::to('/crm/role/' . $rid)->withMessage(Generate::message('Success', 'Featured Unassigned from this role.')); }
public function removeRoleFeature($role_id, $feature_id) { try { FeatureRole::where('role_id', $role_id)->where('feature_id', $feature_id)->delete(); return Redirect::to("/crm/role/{$role_id}")->withMessage(Generate::success_message('Success', 'Removed Successfully')); } catch (Exception $e) { return Redirect::to("/crm/role/{$role_id}")->withMessage(Generate::error_message('Fail', 'Failed to remove feature.')); } }