Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValidatesRequest does a pjax check te determine the return format, FormRequest doesn't #13997

Closed
sebastiandedeyne opened this issue Jun 15, 2016 · 1 comment

Comments

@sebastiandedeyne
Copy link
Contributor

sebastiandedeyne commented Jun 15, 2016

In Illuminate\Foundation\Validation\ValidatesRequest:

if (($request->ajax() && ! $request->pjax()) || $request->wantsJson()) {
    return new JsonResponse($errors, 422);
}

In Illuminate\Foundation\Http\FormRequest:

if ($this->ajax() || $this->wantsJson()) {
    return new JsonResponse($errors, 422);
}

Pjax doesn't work with form requests as it is now. I think ValidatesRequest has the intended behaviour. Is there a reason for this, or can a pjax check be added to FormRequest too, to keep it consistent?

@GrahamCampbell
Copy link
Member

Thanks for the report. Closing since we now have a PR open. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants