#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →

Handling Form Requests

Forms are one of the most common ways users interact with a web application, whether they're signing up, submitting a comment, or updating a profile. Laravel provides a consistent way to receive and work with that submitted data.

Submitting a Form

A typical Blade form posts to a named route, and Laravel automatically expects a CSRF token to be present for any state-changing request made from a browser. This token is generated per session and verified automatically by Laravel's middleware.

Reading Submitted Data

Inside a controller, the incoming request is represented by Laravel's Request object, which is automatically injected when type-hinted in a method. From there, individual fields, all input, or only specific fields can be pulled out as needed.

MethodWhat It Returns
$request->input('name')A single field's value
$request->all()Every submitted field as an array
$request->only(['name','email'])Just the specified fields
$request->has('field')Whether a given field was submitted
$request->file('avatar')An uploaded file, if one was included

Good Practices for Handling Forms

Reading form data is only half the job — before anything is saved, it needs to be checked for correctness, which is exactly where Laravel's validation system comes in.

Ready to master Laravel Training Course?

Join Uncodemy's hands-on Laravel program and build real, production-ready applications.

Explore Course