Request
class Request (View source)
Methods
Request constructor
Set the request id
Get the request ID
Alias of getId
Singletons loader
Check if key is existing
Get all input value
Get uri send by client.
Get the host name of the server.
Get url sent by client.
Origin the name of the server + the scheme
Get path sent by client.
Returns the method of the request.
Check if the query is POST
Check if the query is of type GET
Check if the query is of type PUT
Check if the query is DELETE
Load the factory for FILES
Check if file exists
Get previous request data
Check if we are in the case of an AJAX request.
Check if a url matches with the pattern
Check if a url matches with the pattern
Get client address
Get client port
Get the source of the current request.
Get the request locale.
Get request lang.
Get request protocol
Check the protocol of the request
Check if the secure protocol
Get Request header
Get Request header
Check if a header exists.
Get the client user agent
Get auth user information
Get cookie
Retrieve a value or a collection of values.
Retrieves the values contained in the exception table
Retrieves the rest of values
Set the shared value in request bags
Get the shared value in request bags
Set the shared value in request bags
Get the shared value in request bags
__call
Details
mixed
capture()
Request constructor
void
setId(string|int $id)
Set the request id
string|int
getId()
Get the request ID
string|int
id()
Alias of getId
static Request
getInstance()
Singletons loader
bool
has(string $key)
Check if key is existing
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, mixed $fullback)
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
bool
isReferer(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.
The local is the original language of the client e.g fr => locale = fr_FR e.g en => locale [ en_US, en_EN]
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
array
getHeaders()
Get Request header
string|null
getHeader(string $key)
Get Request header
bool
hasHeader(string $key)
Check if a header exists.
string|null
userAgent()
Get the client user agent
Session
session()
Get session information
Authentication|null
user(string|null $guard = null)
Get auth user information
string|array|object|null
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
array
ignore(array $ignores = [])
Retrieves the rest of values
Validate
validate(array $rule)
Validate incoming data
void
setBag(string $name, mixed $value)
Set the shared value in request bags
mixed
getBag(string $name)
Get the shared value in request bags
void
setBags(array $bags)
Set the shared value in request bags
array
getBags()
Get the shared value in request bags
mixed
__get($property)
__call