Version: v0.6.1 - Beta.  We welcome contributors & feedback.  THanks!, validationRule='id')


Get an input field sent in a POST request (usually via a form or Ajax request).

It will be validated per $validationRule. (See Input Validation)

If $validationRule is an empty string, it will look for a rule that is contained in the field name.

SecurityPost requests must come from the same origin and contain a CSRF token, which you can get via Web.csrfToken(). Use Input.remote if you wish to accept requests without these safeguards.

// post data: { userId: 12345, age: 39 }'userId', 'id');
//= 12345

// Uses 'id' rule because the name ends in '-id''userId');
//= 12345'age', 'i|min:1|max:130');
//= 39'age', 'old');
//= ''  (invalid)

See Also