Support the ongoing development of Laravel.io →
Requests Input Eloquent
Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

Thanks TerrePorter, that’s more than helpful! Went with $request->all() and works perfectly.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.