Laravel 5 当我使用验证请求来验证唯一性时,在laravel中获得过多的错误重定向

Laravel 5 当我使用验证请求来验证唯一性时,在laravel中获得过多的错误重定向,laravel-5,laravel-5.2,Laravel 5,Laravel 5.2,我使用自定义请求页面从post请求中获取值 在这个请求中,我正在验证 namespace App\Http\Requests; use App\Http\Requests\Request; class TaxclassRequest extends Request { /** * Determine if the user is authorized to make this request. * * @return bool */ p

我使用自定义请求页面从post请求中获取值

在这个请求中,我正在验证

namespace App\Http\Requests; use App\Http\Requests\Request; class TaxclassRequest extends Request { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ "tax_class"=>'unique:taxes,tax_class' ]; } } 名称空间App\Http\Requests; 使用App\Http\Requests\Request; 类TaxclassRequest扩展请求 { /** *确定用户是否有权提出此请求。 * *@returnbool */ 公共职能授权() { 返回true; } /** *获取应用于请求的验证规则。 * *@return数组 */ 公共职能规则() { 返回[ “税类”=>“唯一:税,税类” ]; } } 我的控制器是

function insert(TaxclassRequest $request) { $n=$request->input('number'); //total number of variable that has been created dyanamic $tax_class=$request->input("tax_class"); // tax_class . . . other code 函数插入(TaxclassRequest$request) { $n=$request->input('number');//已创建的变量总数 $tax_class=$request->input(“tax_class”);//tax_class . . . 其他代码 我犯了一个错误

错误\u太多\u重定向

您的代码上有循环吗?如果有无限循环,则可能会发生此错误