由于团队请求而不是参数中的请求,无法使用表单击中控制器



以一种形式,我有:

{!! Form::open(['url'=>URL::action("TeamController@store",$tournament->slug)]) !!}
   <button type="submit" class="btn btn-primary">Submit</button>
{!! Form::close() !!}

单击它时,我不输入TeamContoller@store

public function store(TeamRequest $request, Tournament $tournament)

但是,如果我将TeamRequest更改为请求,现在它有效...

这是TeamRequest:

namespace AppHttpRequests;
class TeamRequest 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 [
            'name' => 'required',
            'championship_id' => 'required',
        ];
    }
}

为什么会发生????

i解决了它:

use IlluminateHttpRequest;

int我的TeamRequeset文件

最新更新