top-think/think

验证场景中同一规则 remove 后再 append 就不生效了

yangfancn opened this issue · 3 comments

原规则时这样的
'action|动作' => 'requireWith:pid|regex:^\/[a-zA-Z_]+\/[a-zA-Z_]+$|unique:admin_auth_rules',
我想在更新数据的时候给 unique 加上 id
public function sceneUpdate(): self { return $this->remove('action', 'unique') ->append('action', 'unique:admin_auth_rules,action,' . request()->param('id')); }
这样 unique 就完全被移除了,append 并未生效

你好,我也碰到了这个问题,想请问一下你解决了吗?没办法的话只能自己魔改了

@muum641651
没有哦,
不过要满足我的需求的话,是不需要加ID的,直接用就可以了

我自己简单地修改了下源码,可以看看交流一下:https://zhuanlan.zhihu.com/p/436010013