当我使用Request for validation验证unique时,在laravel中获取err_too_many_redirects

时间:2016-03-31 08:44:00

标签: laravel-5 laravel-5.2

it is my error page

我使用了自定义请求页面来发布请求中的值。

在该请求中我正在验证

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'
        ];
    }
}

我的控制器是


    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

我收到错误 ERR_TOO_MANY_REDIRECTS

0 个答案:

没有答案