Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

常驻内存,rule规则不释放 #2

Open
yunsimple opened this issue Apr 9, 2023 · 1 comment
Open

常驻内存,rule规则不释放 #2

yunsimple opened this issue Apr 9, 2023 · 1 comment

Comments

@yunsimple
Copy link

假设我有请求A,有两个方法function1和function2。

在function1中我需要验证type, $validate = Validate::rule('type', 'require|number')。

在function2中我需要验证page这个参数,$validate = Validate::rule('page', 'number|max:4')。

当我验证function2中的时候,他却报出了type必须填写,他这个$validate由于是静态方法,规则会一直存在,我现在使用->only方法似乎可以解决问题,但是感觉不够优雅,一般像这种情况该如何优雅的解决问题。

@Tinywan
Copy link
Owner

Tinywan commented Apr 9, 2023

欢迎提价PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants