class Illuminate / Http / Request

Request

Extends

    Symfony\...\Request

Implements

Uses

Properties

protected

$json Symfony\...\InputBag|null

The decoded JSON content for the request.

Default: null
protected

$convertedFiles array

All of the converted files for the request.

Default: null
protected

$userResolver Closure

The user resolver callback.

Default: null
protected

$routeResolver Closure

The route resolver callback.

Default: null

Methods

public static

capture ( ) : static

Create a new Illuminate HTTP request from server variables.

public

instance ( ) : $this

Return the Request instance.

public

method ( ) : string

Get the request method.

public

root ( ) : string

Get the root URL for the application.

public

url ( ) : string

Get the URL (no query string) for the request.

public

fullUrl ( ) : string

Get the full URL for the request.

public

fullUrlWithQuery ( array $query ) : string

Get the full URL for the request with the added query string parameters.

Parameters

  • $query array
public

fullUrlWithoutQuery ( $keys ) : string

Get the full URL for the request without the given query string parameters.

Parameters

  • $keys array|string
public

path ( ) : string

Get the current path info for the request.

public

decodedPath ( ) : string

Get the current decoded path info for the request.

public

segment ( $index , $default ) : string|null

Get a segment from the URI (1 based index).

Parameters

  • $index int
  • $default string|null
public

segments ( ) : array

Get all of the segments for the request path.

public

is ( $patterns ) : bool

Determine if the current request URI matches a pattern.

Parameters

  • $patterns mixed
public

routeIs ( $patterns ) : bool

Determine if the route name matches a given pattern.

Parameters

  • $patterns mixed
public

fullUrlIs ( $patterns ) : bool

Determine if the current request URL and query string match a pattern.

Parameters

  • $patterns mixed
public

host ( ) : string

Get the host name.

public

httpHost ( ) : string

Get the HTTP host being requested.

public

schemeAndHttpHost ( ) : string

Get the scheme and HTTP host.

public

ajax ( ) : bool

Determine if the request is the result of an AJAX call.

public

pjax ( ) : bool

Determine if the request is the result of a PJAX call.

public

prefetch ( ) : bool

Determine if the request is the result of a prefetch call.

public

secure ( ) : bool

Determine if the request is over HTTPS.

public

ip ( ) : string|null

Get the client IP address.

public

ips ( ) : array

Get the client IP addresses.

public

userAgent ( ) : string|null

Get the client user agent.

public

merge ( array $input ) : $this

Merge new input into the current request's input array.

Parameters

  • $input array
public

mergeIfMissing ( array $input ) : $this

Merge new input into the request's input, but only when that key is missing from the request.

Parameters

  • $input array
public

replace ( array $input ) : $this

Replace the input for the current request.

Parameters

  • $input array
public

get ( string $key , mixed $default ) : mixed

This method belongs to Symfony HttpFoundation and is not usually needed when using Laravel.

Parameters

  • $key string
  • $default mixed
public

json ( $key , $default ) : Symfony\...\InputBag|mixed

Get the JSON payload for the request.

Parameters

  • $key string|null
  • $default mixed
protected

getInputSource ( ) : Symfony\...\InputBag

Get the input source for the request.

public static

createFrom ( $from , $to ) : static

Create a new request instance from the given Laravel request.

Parameters

public static

createFromBase ( Symfony\...\Request $request ) : static

Create an Illuminate request from a Symfony instance.

Parameters

  • $request Symfony\...\Request
public

duplicate ( array $query , array $request , array $attributes , array $cookies , array $files , array $server ) : static

{@inheritdoc}

protected

filterFiles ( $files ) : mixed

Filter the given array of files, removing any empty values.

Parameters

  • $files mixed
public

hasSession ( bool $skipIfUninitialized ) : void

{@inheritdoc}

public

getSession ( ) : void

{@inheritdoc}

public

session ( ) : Session

Get the session associated with the request.

public

setLaravelSession ( $session ) : void

Set the session instance on the request.

Parameters

public

setRequestLocale ( string $locale ) : void

Set the locale for the request instance.

Parameters

  • $locale string
public

setDefaultRequestLocale ( string $locale ) : void

Set the default locale for the request instance.

Parameters

  • $locale string
public

user ( $guard ) : mixed

Get the user making the request.

Parameters

  • $guard string|null
public

route ( $param , $default ) : Route |object|string|null

Get the route handling the request.

Parameters

  • $param string|null
  • $default mixed
public

fingerprint ( ) : string

Get a unique fingerprint for the request / route / IP address.

public

setJson ( $json ) : $this

Set the JSON payload for the request.

Parameters

  • $json Symfony\...\InputBag
public

getUserResolver ( ) : Closure

Get the user resolver callback.

public

setUserResolver ( Closure $callback ) : $this

Set the user resolver callback.

Parameters

public

getRouteResolver ( ) : Closure

Get the route resolver callback.

public

setRouteResolver ( Closure $callback ) : $this

Set the route resolver callback.

Parameters

public

toArray ( ) : array

Get all of the input and files for the request.

public

offsetExists ( $offset ) : bool

Determine if the given offset exists.

Parameters

  • $offset string
public

offsetGet ( $offset ) : mixed

Get the value at the given offset.

Parameters

  • $offset string
public

offsetSet ( $offset , $value ) : void

Set the value at the given offset.

Parameters

  • $offset string
  • $value mixed
public

offsetUnset ( $offset ) : void

Remove the value at the given offset.

Parameters

  • $offset string
public

__isset ( $key ) : bool

Check if an input element is set on the request.

Parameters

  • $key string
public

__get ( $key ) : mixed

Get an input element from the request.

Parameters

  • $key string