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

转手函数提示错误 #5

Open
sym134 opened this issue Dec 30, 2023 · 5 comments
Open

转手函数提示错误 #5

sym134 opened this issue Dec 30, 2023 · 5 comments

Comments

@sym134
Copy link

sym134 commented Dec 30, 2023

错误内容:
Typed property Tinywan\Validate\Validate::$currentScene must not be accessed before initialization

代码:

 validate($request->post(),[
            'device_id'      => 'require|number',
        ]);

助手函数不能这样写吗?

@Tinywan
Copy link
Owner

Tinywan commented Dec 31, 2023

第二个参数需要指定验证器

validate($params, ScheduleValidate::class . '.im_group');

@sym134
Copy link
Author

sym134 commented Dec 31, 2023

第二个参数需要指定验证器

validate($params, ScheduleValidate::class . '.im_group');

validate方法写的,第二个参数可以传数组规则,意思实际不可以?

@Tinywan
Copy link
Owner

Tinywan commented Dec 31, 2023

详细使用可以参考这里:https://doc.thinkphp.cn/v8_0/validator.html

@sym134
Copy link
Author

sym134 commented Jan 1, 2024

image 也是一样的错误

@Tinywan
Copy link
Owner

Tinywan commented Jan 2, 2024

提示什么错误

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