Skip to content

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

@yunsimple

Description

@yunsimple

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

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

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions