Skip to content

Form Requests

albertmoreno edited this page Aug 10, 2015 · 3 revisions

The easiest way to use this package is reusing your FormRequest to create the Javascript validations.

$validator = JsValidator::formRequest('App\Http\Request\MyFormRequest');
$validator = JsValidator::formRequest('App\Http\Request\MyFormRequest', '#my-form');

First parameter is the fully qualified class name or instance of the FormRequest that you want to validate.

Second (optional) parameter is the JQuery form selector to find the form to validate. If is not specified the form_selector configuration will be used.