Support the ongoing development of Laravel.io →
posted 9 years ago
Input
Last updated 1 year ago.
0

$someInput = Request::input('someInput');

0

@resethread what you suggest it's muddy solution,cause it can throw exception because you are calling a non static method statically.

Last updated 7 years ago.
0

I think you could catch the Request object
public function index() { return view('addproduct'); }

public function save(Request $request)
{   
    echo $productname = $request->input('productname');
}
Last updated 7 years ago.
0

jay4yam said:

I think you could catch the Request object
public function index() { return view('addproduct'); }

public function save(Request $request) {
echo $productname = $request->input('productname'); }

THIS is the way to go. Injecting the Request into the method and using it is the preferred method.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

franklinfs franklinfs Joined 14 Apr 2015

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.