@resethread what you suggest it's muddy solution,cause it can throw exception because you are calling a non static method statically.
I think you could catch the Request object
public function index()
{
return view('addproduct');
}
public function save(Request $request)
{
echo $productname = $request->input('productname');
}
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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community