Laravel required_with_all错误

时间:2014-03-29 22:58:05

标签: php laravel-4

尝试使用require_with_all时出现以下错误:

方法[validateRequiredWithAll]不存在。

验证:

            'player6_name' => 'alpha|required_with_all:player6_summoner,player6_position,player6_email',
            'player6_summoner' => 'required_with_all:player6_name,player6_position,player6_email',
            'player6_position' => 'required_with_all:player6_summoner,player6_name,player6_email',
            'player6_email' => 'email|required_with_all:player6_summoner,player6_position,player6_name',
            'player6_student' => '',
            'player6_society' => '',
            'player7_name' => 'alpha|required_with_all:player7_summoner,player7_position,player7_email',
            'player7_summoner' => 'required_with_all:player7_name,player7_position,player7_email',
            'player7_position' => 'required_with_all:player7_summoner,player7_name,player7_email',
            'player7_email' => 'email|required_with_all:player7_summoner,player7_position,player7_name',
            'player7_student' => '',
            'player7_society' => ''),

1 个答案:

答案 0 :(得分:1)

Mabe你正在使用不同版本的laravel,在版本4.1方法中,validateRequiredWithAll存在并且验证工作正常。

该方法是illuminte / validation软件包的一部分,但如果要使用它,则不会在版本4.0(https://github.com/illuminate/validation/blob/4.0/Validator.php)更新到4.1中。