class Request (View source)

Methods

static Request
getInstance()

Singletons loader

bool
has(string $key)

Check if key is exists

array
all()

Get all input value

string
path()

Get uri send by client.

string
hostname()

Get the host name of the server.

string
url()

Get url sent by client.

string
origin()

Origin the name of the server + the scheme

string
time()

Get path sent by client.

string|null
method()

Returns the method of the request.

bool
isPost()

Check if the query is POST

bool
isGet()

Check if the query is of type GET

bool
isPut()

Check if the query is of type PUT

bool
isDelete()

Check if the query is DELETE

Collection|null
file(string $key)

Load the factory for FILES

static bool
hasFile(mixed $file)

Check if file exists

mixed
old(string $key)

Get previous request data

bool
isAjax()

Check if we are in the case of an AJAX request.

bool
is(string $match)

Check if a url matches with the pattern

string|null
ip()

Get client address

string|null
port()

Get client port

string
referer()

Get the source of the current request.

string|null
locale()

Get the request locale.

string|null
lang()

Get request lang.

string
protocol()

Get request protocol

bool
isProtocol(string $protocol)

Check the protocol of the request

bool
isSecure()

Check if the secure protocol

string|null
getHeader(string $key)

Get Request header

bool
hasHeader(string $key)

Check if a header exists.

session()

Get session information

Authentication|null
user(string|null $guard = null)

Get auth user information

mixed
cookie(string $property = null)

Get cookie

mixed
get(string $key, mixed $default = null)

Retrieve a value or a collection of values.

array
only(array $exceptions)

Retrieves the values contained in the exception table

ignore($ignores)

No description

validate(array $rule)

Validate incoming data

mixed
setBag(string $name, mixed $value)

Set the value in request bag

mixed
getBag($name)

Get the value in request bag

mixed
__get($property)

__call

Details

static Request getInstance()

Singletons loader

Return Value

Request

bool has(string $key)

Check if key is exists

Parameters

string $key

Return Value

bool

array all()

Get all input value

Return Value

array

string path()

Get uri send by client.

Return Value

string

string hostname()

Get the host name of the server.

Return Value

string

string url()

Get url sent by client.

Return Value

string

string origin()

Origin the name of the server + the scheme

Return Value

string

string time()

Get path sent by client.

Return Value

string

string|null method()

Returns the method of the request.

Return Value

string|null

bool isPost()

Check if the query is POST

Return Value

bool

bool isGet()

Check if the query is of type GET

Return Value

bool

bool isPut()

Check if the query is of type PUT

Return Value

bool

bool isDelete()

Check if the query is DELETE

Return Value

bool

Collection|null file(string $key)

Load the factory for FILES

Parameters

string $key

Return Value

Collection|null

static bool hasFile(mixed $file)

Check if file exists

Parameters

mixed $file

Return Value

bool

mixed old(string $key)

Get previous request data

Parameters

string $key

Return Value

mixed

bool isAjax()

Check if we are in the case of an AJAX request.

Return Value

bool

bool is(string $match)

Check if a url matches with the pattern

Parameters

string $match

Return Value

bool

string|null ip()

Get client address

Return Value

string|null

string|null port()

Get client port

Return Value

string|null

string referer()

Get the source of the current request.

Return Value

string

string|null locale()

Get the request locale.

The local is the original language of the client e.g fr => locale = fr_FR e.g en => locale [ en_US, en_EN]

Return Value

string|null

string|null lang()

Get request lang.

Return Value

string|null

string protocol()

Get request protocol

Return Value

string

bool isProtocol(string $protocol)

Check the protocol of the request

Parameters

string $protocol

Return Value

bool

bool isSecure()

Check if the secure protocol

Return Value

bool

string|null getHeader(string $key)

Get Request header

Parameters

string $key

Return Value

string|null

bool hasHeader(string $key)

Check if a header exists.

Parameters

string $key

Return Value

bool

Session session()

Get session information

Return Value

Session

Authentication|null user(string|null $guard = null)

Get auth user information

Parameters

string|null $guard

Return Value

Authentication|null

Get cookie

Parameters

string $property

Return Value

mixed

mixed get(string $key, mixed $default = null)

Retrieve a value or a collection of values.

Parameters

string $key
mixed $default

Return Value

mixed

array only(array $exceptions)

Retrieves the values contained in the exception table

Parameters

array $exceptions

Return Value

array

ignore($ignores)

No description

Parameters

$ignores

Validate validate(array $rule)

Validate incoming data

Parameters

array $rule

Return Value

Validate

mixed setBag(string $name, mixed $value)

Set the value in request bag

Parameters

string $name
mixed $value

Return Value

mixed

mixed getBag($name)

Get the value in request bag

Parameters

$name

Return Value

mixed

mixed __get($property)

__call

Parameters

$property

Return Value

mixed