To obtain an instance of an HTTP Request, class Illuminate\Http\Request
need to be type hint either in the constructor or the method of the controller.
Example code:
<?php namespace App\Http\Controllers; /* Here how we illuminate the request class in controller */ use Illuminate\Http\Request; use Illuminate\Routing\Controller; class PostController extends Controller { /** * Store a new post. * * @param Request $request * @return Response */ public function store(Request $request) { $name = $request->input('post_title'); /* * so typecasting Request class in our method like above avails the * HTTP GET/POST/PUT etc method params in the controller to use and * manipulate */ } }