Home >Backend Development >PHP Tutorial >如何玩转 laravel5中验证器AJAX自动返回的JSON

如何玩转 laravel5中验证器AJAX自动返回的JSON

WBOY
WBOYOriginal
2016-06-06 20:26:121390browse

自动返回这种数据 {"company_number":["fuckyou"]}

没有在控制器中可以定制。

回复内容:

自动返回这种数据 {"company_number":["fuckyou"]}

没有在控制器中可以定制。

这里。
但不是放在控制器中,而是 生成的类会放置在 app/Http/Requests 目录中。 我们在 rules 方法中增加一些验证规则
http://laravel-china.org/docs/5.0/validation#form-request-validation

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn