Accessing Request

Get an instance of the current request by type-hinting the controller action or route closure

// controller action
class UserController extends Controller
{
    public function store(Request $request)
 {
        $name = $request->input('name');
    }
}
// closure
Route::get('/', function (Request $request) {
    //
});

See Routing

Comments