Laravel - Requests - Retrieving Input From The Query String

While the input method retrieves values from the entire request payload (including the query string), the query method will only retrieve values from the query string:

    $name = $request->query('name');

If the requested query string value data is not present, the second argument to this method will be returned:

    $name = $request->query('name', 'Helen');

You may call the query method without any arguments in order to retrieve all of the query string values as an associative array:

    $query = $request->query();