class Request (View source)

Methods

static Request
getInstance()

Singletons loader

mixed
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
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

file(string $key)

Load the factory for FILES

static bool
hasFile(mixed $file)

Check if file exists

mixed
old(string $key, mixed $fullback = null)

Get previous request data

bool
isAjax()

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

int
is(string $match)

Check if a url matches with the pattern

string
ip()

Get client address

string
port()

Get client port

string
referer()

Get the source of the current request.

string|null
locale()

Get the request locale.

string
lang()

Get request lang.

mixed
protocol()

Get request protocol

mixed
isProtocol(string $protocol)

Check the protocol of the request

mixed
isSecure()

Check if the secure protocol

bool|string
getHeader(string $key)

Get Request header

bool
hasHeader(string $key)

Check if a header exists.

session()

Get session information

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

mixed has(string $key)

Check if key is exists

Parameters

string $key

Return Value

mixed

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 method()

Returns the method of the request.

Return Value

string

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

UploadFile|Collection file(string $key)

Load the factory for FILES

Parameters

string $key

Return Value

UploadFile|Collection

static bool hasFile(mixed $file)

Check if file exists

Parameters

mixed $file

Return Value

bool

mixed old(string $key, mixed $fullback = null)

Get previous request data

Parameters

string $key
mixed $fullback

Return Value

mixed

bool isAjax()

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

Return Value

bool

int is(string $match)

Check if a url matches with the pattern

Parameters

string $match

Un regex

Return Value

int

string ip()

Get client address

Return Value

string

string port()

Get client port

Return Value

string

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 lang()

Get request lang.

Return Value

string

mixed protocol()

Get request protocol

Return Value

mixed

mixed isProtocol(string $protocol)

Check the protocol of the request

Parameters

string $protocol

Return Value

mixed

mixed isSecure()

Check if the secure protocol

Return Value

mixed

bool|string getHeader(string $key)

Get Request header

Parameters

string $key

Return Value

bool|string

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