hkg*_*ile 2 php laravel laravel-5.2
在下面的函数中, $input['num_opt'] 不能访问 $input
$input = $request->all();
$validator->after(function($validator) {
$num_opt = $input['num_opt'];
if ($this->isValidOpt($num_opt)) {
$validator->errors()->add('num_opt', 'Something is wrong with this field!');
echo 'test';
}
});
Run Code Online (Sandbox Code Playgroud)
在函数内部传递 $input 的最佳做法是什么。
| 归档时间: |
|
| 查看次数: |
603 次 |
| 最近记录: |