Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我们在几乎所有具有相同验证规则的表中都有相同的字段,例如类似slug的东西,是否可以创建一个规则来处理具有 slug 字段的所有请求的验证?
您可以创建一个主请求验证类并在所有控制器中使用它,并且在请求中您需要更多规则,您可以从该主请求类继承以添加更多规则