Here are a few ways, that I know of, to get the form data after the FormRequest validation.
- grabs input and files
$request->all()
- input is the post data, if it is not a get request or then it is the get vars
$request->input() can specify a key, default or empty returns all
- check if a input field exists
$request->has('fieldname')
- get a group of specified keys
$request->only(?) array or string
- get a single field
$request->get('fieldname)
- you can also use
$request->fieldname
These all come from Illuminate\Http\Request which FormRequest extends to.
There is a screencast at https://laracasts.com/series/whats-new-in-laravel-5/episodes/3 that also covers the basics of the FormRequest validation.
Hope that helps.
Thanks TerrePorter, that’s more than helpful! Went with $request->all()
and works perfectly.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community