LaravelRequest

File
request.php
Package
Default
Class hierarchy
LaravelRequest

Tags

None found

Constants

spoofer

spoofer

The request data key that is used to indicate a spoofed request method.

Tags

None found

Properties

$route

$route : array

All of the route instances handling the request.

Type

array

Tags

None found

$foundation

$foundation : \Laravel\HttpFoundation\Request

The Symfony HttpFoundation Request instance.

Type

LaravelHttpFoundationRequest

Tags

None found

Methods

uri()

uri() : string

Get the URI for the current request.

Returns

string

static

Tags

None found

method()

method() : string

Get the request method.

Returns

string

static

Tags

None found

header()

header(string  $key, mixed  $default = null) : mixed

Get a header from the request.

// Get a header from the request $referer = Request::header('referer');

Parameters

string $key
mixed $default

Returns

mixed

static

Tags

None found

headers()

headers() : array

Get all of the HTTP request headers.

Returns

array

static

Tags

None found

server()

server(string  $key = null, mixed  $default = null) : string

Get an item from the $_SERVER array.

Parameters

string $key
mixed $default

Returns

string

static

Tags

None found

spoofed()

spoofed() : boolean

Determine if the request method is being spoofed by a hidden Form element.

Returns

boolean

static

Tags

None found

ip()

ip(mixed  $default = '0.0.0.0') : string

Get the requestor's IP address.

Parameters

mixed $default

Returns

string

static

Tags

None found

accept()

accept() : array

Get the list of acceptable content types for the request.

Returns

array

static

Tags

None found

accepts()

accepts(string  $type) : boolean

Determine if the request accepts a given content type.

Parameters

string $type

Returns

boolean

static

Tags

None found

languages()

languages() : array

Get the languages accepted by the client's browser.

Returns

array

static

Tags

None found

secure()

secure() : boolean

Determine if the current request is using HTTPS.

Returns

boolean

static

Tags

None found

forged()

forged() : boolean

Determine if the request has been forged.

The session CSRF token will be compared to the CSRF token in the request input.

Returns

boolean

static

Tags

None found

ajax()

ajax() : boolean

Determine if the current request is an AJAX request.

Returns

boolean

static

Tags

None found

referrer()

referrer() : string

Get the HTTP referrer for the request.

Returns

string

static

Tags

None found

time()

time() : integer

Get the timestamp of the time when the request was started.

Returns

integer

static

Tags

None found

cli()

cli() : boolean

Determine if the current request is via the command line.

Returns

boolean

static

Tags

None found

env()

env() : string|null

Get the Laravel environment for the current request.

Returns

string|null

static

Tags

None found

set_env()

set_env(string  $env) : void

Set the Laravel environment for the current request.

Parameters

string $env

static

Tags

None found

is_env()

is_env(string  $env) : boolean

Determine the current request environment.

Parameters

string $env

Returns

boolean

static

Tags

None found

detect_env()

detect_env(array  $environments, string  $uri) : string|null

Detect the current environment from an environment configuration.

Parameters

array $environments
string $uri

Returns

string|null

static

Tags

None found

route()

route() : \Laravel\Route

Get the main route handling the request.

Returns

LaravelRoute

static

Tags

None found

foundation()

foundation() : \Laravel\HttpFoundation\Request

Get the Symfony HttpFoundation Request instance.

Returns

LaravelHttpFoundationRequest

static

Tags

None found

__callStatic()

__callStatic(string  $method, array  $parameters) : mixed

Pass any other methods to the Symfony request.

Parameters

string $method
array $parameters

Returns

mixed

static

Tags

None found