PHP 클래스 Request, someline-starter

This makes PHP code quality analyzer tools very happy.
또한 보기: http://php.net/manual/en/reserved.variables.request.php
파일 보기 프로젝트 열기: someline/someline-starter 1 사용 예제들

공개 메소드들

메소드 설명
accepts ( string | array $contentTypes ) : boolean Determines whether the current requests accepts a given content type.
acceptsHtml ( ) : boolean Determines whether a request accepts HTML.
acceptsJson ( ) : boolean Determines whether a request accepts JSON.
ajax ( ) : boolean Determine if the request is the result of an AJAX call.
all ( ) : array Get all of the input and files for the request.
allFiles ( ) : array Get an array of all of the files on the request.
bearerToken ( ) : string | null Get the bearer token from the request headers.
capture ( ) : static Create a new Illuminate HTTP request from server variables.
cookie ( string $key = null, string | array | null $default = null ) : string | array Retrieve a cookie from the request.
create ( string $uri, string $method = 'GET', array $parameters = [], array $cookies = [], array $files = [], array $server = [], string $content = null ) : Request Creates a Request based on a given URI and configuration.
createFromBase ( Request $request ) : Illuminate\Http\Request Create an Illuminate request from a Symfony instance.
createFromGlobals ( ) : Request Creates a new request with values from PHP's super globals.
decodedPath ( ) : string Get the current encoded path info for the request.
duplicate ( array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null ) : Request Clones a request and overrides some of its parameters.
enableHttpMethodParameterOverride ( ) Enables support for the _method request parameter to determine the intended HTTP method.
except ( array | mixed $keys ) : array Get all of the input except for a specified array of items.
exists ( string | array $key ) : boolean Determine if the request contains a given input item key.
file ( string $key = null, mixed $default = null ) : Illuminate\Http\UploadedFile | array | null Retrieve a file from the request.
fingerprint ( ) : string Get a unique fingerprint for the request / route / IP address.
flash ( string $filter = null, array $keys = [] ) : void Flash the input for the current request to the session.
flashExcept ( array | mixed $keys ) : void Flash only some of the input to the session.
flashOnly ( array | mixed $keys ) : void Flash only some of the input to the session.
flush ( ) : void Flush all of the old input from the session.
format ( string $default = 'html' ) : string Get the data format expected in the response.
fullUrl ( ) : string Get the full URL for the request.
fullUrlIs ( ) : boolean Determine if the current request URL and query string matches a pattern.
fullUrlWithQuery ( array $query ) : string Get the full URL for the request with the added query string parameters.
get ( string $key, mixed $default = null ) : mixed Gets a "parameter" value from any bag.
getAcceptableContentTypes ( ) : array Gets a list of content types acceptable by the client browser.
getBasePath ( ) : string Returns the root path from which this request is executed.
getBaseUrl ( ) : string Returns the root URL from which this request is executed.
getCharsets ( ) : array Gets a list of charsets acceptable by the client browser.
getClientIp ( ) : string Returns the client IP address.
getClientIps ( ) : array Returns the client IP addresses.
getContent ( boolean $asResource = false ) : string | resource Returns the request body content.
getContentType ( ) : string | null Gets the format associated with the request.
getDefaultLocale ( ) : string Get the default locale.
getETags ( ) : array Gets the Etags.
getEncodings ( ) : array Gets a list of encodings acceptable by the client browser.
getFormat ( string $mimeType ) : string | null Gets the format associated with the mime type.
getHost ( ) : string Returns the host name.
getHttpHost ( ) : string Returns the HTTP host being requested.
getHttpMethodParameterOverride ( ) : boolean Checks whether support for the _method request parameter is enabled.
getLanguages ( ) : array Gets a list of languages acceptable by the client browser.
getLocale ( ) : string Get the locale.
getMethod ( ) : string Gets the request "intended" method.
getMimeType ( string $format ) : string Gets the mime type associated with the format.
getPassword ( ) : string | null Returns the password.
getPathInfo ( ) : string Returns the path being requested relative to the executed script.
getPort ( ) : string Returns the port on which the request is made.
getPreferredLanguage ( array $locales = null ) : string | null Returns the preferred language.
getQueryString ( ) : string | null Generates the normalized query string for the Request.
getRealMethod ( ) : string Gets the "real" request method.
getRelativeUriForPath ( string $path ) : string Returns the path as relative reference from the current Request path.
getRequestFormat ( string $default = 'html' ) : string Gets the request format.
getRequestUri ( ) : string Returns the requested URI (path and query string).
getRouteResolver ( ) : Closure Get the route resolver callback.
getScheme ( ) : string Gets the request's scheme.
getSchemeAndHttpHost ( ) : string Gets the scheme and HTTP host.
getScriptName ( ) : string Returns current script name.
getSession ( ) : Symfony\Component\HttpFoundation\SessionInterface | null Gets the Session.
getTrustedHeaderName ( string $key ) : string Gets the trusted proxy header name.
getTrustedHosts ( ) : array Gets the list of trusted host patterns.
getTrustedProxies ( ) : array Gets the list of trusted proxies.
getUri ( ) : string Generates a normalized URI (URL) for the Request.
getUriForPath ( string $path ) : string Generates a normalized URI for the given path.
getUser ( ) : string | null Returns the user.
getUserInfo ( ) : string Gets the user info.
getUserResolver ( ) : Closure Get the user resolver callback.
has ( string | array $key ) : boolean Determine if the request contains a non-empty value for an input item.
hasCookie ( string $key ) : boolean Determine if a cookie is set on the request.
hasFile ( string $key ) : boolean Determine if the uploaded data contains a file.
hasHeader ( string $key ) : boolean Determine if a header is set on the request.
hasMacro ( string $name ) : boolean Checks if macro is registered.
hasPreviousSession ( ) : boolean Whether the request contains a Session which was started in one of the previous requests.
hasSession ( ) : boolean Whether the request contains a Session object.
header ( string $key = null, string | array | null $default = null ) : string | array Retrieve a header from the request.
initialize ( array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], string | resource $content = null ) Sets the parameters for this request.
input ( string $key = null, string | array | null $default = null ) : string | array Retrieve an input item from the request.
instance ( ) Return the Request instance.
intersect ( array | mixed $keys ) : array Intersect an array of items with the input data.
ip ( ) : string Returns the client IP address.
ips ( ) : array Returns the client IP addresses.
is ( ) : boolean Determine if the current request URI matches a pattern.
isJson ( ) : boolean Determine if the request is sending JSON.
isMethod ( string $method ) : boolean Checks if the request method is of specified type.
isMethodSafe ( ) : boolean Checks whether the method is safe or not.
isNoCache ( ) : boolean
isSecure ( ) : boolean Checks whether the request is secure or not.
isXmlHttpRequest ( ) : boolean Returns true if the request is a XMLHttpRequest.
json ( string $key = null, mixed $default = null ) : mixed Get the JSON payload for the request.
macro ( string $name, callable $macro ) : void Register a custom macro.
matchesType ( string $actual, string $type ) : boolean Determine if the given content types match.
merge ( array $input ) : void Merge new input into the current request's input array.
method ( ) : string Get the request method.
normalizeQueryString ( string $qs ) : string Normalizes a query string.
offsetExists ( string $offset ) : boolean Determine if the given offset exists.
offsetGet ( string $offset ) : mixed Get the value at the given offset.
offsetSet ( string $offset, mixed $value ) : void Set the value at the given offset.
offsetUnset ( string $offset ) : void Remove the value at the given offset.
old ( string $key = null, string | array | null $default = null ) : string | array Retrieve an old input item.
only ( array | mixed $keys ) : array Get a subset of the items from the input data.
overrideGlobals ( ) Overrides the PHP global variables according to this request instance.
path ( ) : string Get the current path info for the request.
pjax ( ) : boolean Determine if the request is the result of an PJAX call.
prefers ( string | array $contentTypes ) : string | null Return the most suitable content type from the given array based on content negotiation.
query ( string $key = null, string | array | null $default = null ) : string | array Retrieve a query string item from the request.
replace ( array $input ) : void Replace the input for the current request.
root ( ) : string Get the root URL for the application.
route ( string | null $param = null ) : Illuminate\Routing\Route | object | string Get the route handling the request.
secure ( ) : boolean Determine if the request is over HTTPS.
segment ( integer $index, string | null $default = null ) : string | null Get a segment from the URI (1 based index).
segments ( ) : array Get all of the segments for the request path.
server ( string $key = null, string | array | null $default = null ) : string | array Retrieve a server variable from the request.
session ( ) : Illuminate\Session\Store Get the session associated with the request.
setDefaultLocale ( string $locale ) Sets the default locale.
setFactory ( callable | null $callable ) Sets a callable able to create a Request instance.
setFormat ( string $format, string | array $mimeTypes ) Associates a format with mime types.
setLocale ( string $locale ) Sets the locale.
setMethod ( string $method ) Sets the request method.
setRequestFormat ( string $format ) Sets the request format.
setRouteResolver ( Closure $callback ) Set the route resolver callback.
setSession ( Symfony\Component\HttpFoundation\SessionInterface $session ) Sets the Session.
setTrustedHeaderName ( string $key, string $value ) Sets the name for trusted headers.
setTrustedHosts ( array $hostPatterns ) Sets a list of trusted host patterns.
setTrustedProxies ( array $proxies ) Sets a list of trusted proxies.
setUserResolver ( Closure $callback ) Set the user resolver callback.
toArray ( ) : array Get all of the input and files for the request.
url ( ) : string Get the URL (no query string) for the request.
user ( string | null $guard = null ) : mixed Get the user making the request.
wantsJson ( ) : boolean Determine if the current request is asking for JSON in return.

메소드 상세

accepts() 공개 정적인 메소드

Determines whether the current requests accepts a given content type.
public static accepts ( string | array $contentTypes ) : boolean
$contentTypes string | array
리턴 boolean

acceptsHtml() 공개 정적인 메소드

Determines whether a request accepts HTML.
public static acceptsHtml ( ) : boolean
리턴 boolean

acceptsJson() 공개 정적인 메소드

Determines whether a request accepts JSON.
public static acceptsJson ( ) : boolean
리턴 boolean

ajax() 공개 정적인 메소드

Determine if the request is the result of an AJAX call.
public static ajax ( ) : boolean
리턴 boolean

all() 공개 정적인 메소드

Get all of the input and files for the request.
public static all ( ) : array
리턴 array

allFiles() 공개 정적인 메소드

Get an array of all of the files on the request.
public static allFiles ( ) : array
리턴 array

bearerToken() 공개 정적인 메소드

Get the bearer token from the request headers.
public static bearerToken ( ) : string | null
리턴 string | null

capture() 공개 정적인 메소드

Create a new Illuminate HTTP request from server variables.
public static capture ( ) : static
리턴 static

create() 공개 정적인 메소드

The information contained in the URI always take precedence over the other information (server and parameters).
public static create ( string $uri, string $method = 'GET', array $parameters = [], array $cookies = [], array $files = [], array $server = [], string $content = null ) : Request
$uri string The URI
$method string The HTTP method
$parameters array The query (GET) or request (POST) parameters
$cookies array The request cookies ($_COOKIE)
$files array The request files ($_FILES)
$server array The server parameters ($_SERVER)
$content string The raw body data
리턴 Request A Request instance

createFromBase() 공개 정적인 메소드

Create an Illuminate request from a Symfony instance.
public static createFromBase ( Request $request ) : Illuminate\Http\Request
$request Symfony\Component\HttpFoundation\Request
리턴 Illuminate\Http\Request

createFromGlobals() 공개 정적인 메소드

Creates a new request with values from PHP's super globals.
public static createFromGlobals ( ) : Request
리턴 Request A new request

decodedPath() 공개 정적인 메소드

Get the current encoded path info for the request.
public static decodedPath ( ) : string
리턴 string

duplicate() 공개 정적인 메소드

Clones a request and overrides some of its parameters.
public static duplicate ( array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null ) : Request
$query array The GET parameters
$request array The POST parameters
$attributes array The request attributes (parameters parsed from the PATH_INFO, ...)
$cookies array The COOKIE parameters
$files array The FILES parameters
$server array The SERVER parameters
리턴 Request The duplicated request

enableHttpMethodParameterOverride() 공개 정적인 메소드

Be warned that enabling this feature might lead to CSRF issues in your code. Check that you are using CSRF tokens when required. If the HTTP method parameter override is enabled, an html-form with method "POST" can be altered and used to send a "PUT" or "DELETE" request via the _method request parameter. If these methods are not protected against CSRF, this presents a possible vulnerability. The HTTP method can only be overridden when the real HTTP method is POST.

except() 공개 정적인 메소드

Get all of the input except for a specified array of items.
public static except ( array | mixed $keys ) : array
$keys array | mixed
리턴 array

exists() 공개 정적인 메소드

Determine if the request contains a given input item key.
public static exists ( string | array $key ) : boolean
$key string | array
리턴 boolean

file() 공개 정적인 메소드

Retrieve a file from the request.
public static file ( string $key = null, mixed $default = null ) : Illuminate\Http\UploadedFile | array | null
$key string
$default mixed
리턴 Illuminate\Http\UploadedFile | array | null

fingerprint() 공개 정적인 메소드

Get a unique fingerprint for the request / route / IP address.
public static fingerprint ( ) : string
리턴 string

flash() 공개 정적인 메소드

Flash the input for the current request to the session.
public static flash ( string $filter = null, array $keys = [] ) : void
$filter string
$keys array
리턴 void

flashExcept() 공개 정적인 메소드

Flash only some of the input to the session.
public static flashExcept ( array | mixed $keys ) : void
$keys array | mixed
리턴 void

flashOnly() 공개 정적인 메소드

Flash only some of the input to the session.
public static flashOnly ( array | mixed $keys ) : void
$keys array | mixed
리턴 void

flush() 공개 정적인 메소드

Flush all of the old input from the session.
public static flush ( ) : void
리턴 void

format() 공개 정적인 메소드

Get the data format expected in the response.
public static format ( string $default = 'html' ) : string
$default string
리턴 string

fullUrl() 공개 정적인 메소드

Get the full URL for the request.
public static fullUrl ( ) : string
리턴 string

fullUrlIs() 공개 정적인 메소드

Determine if the current request URL and query string matches a pattern.
public static fullUrlIs ( ) : boolean
리턴 boolean

fullUrlWithQuery() 공개 정적인 메소드

Get the full URL for the request with the added query string parameters.
public static fullUrlWithQuery ( array $query ) : string
$query array
리턴 string

get() 공개 정적인 메소드

This method is mainly useful for libraries that want to provide some flexibility. If you don't need the flexibility in controllers, it is better to explicitly get request parameters from the appropriate public property instead (attributes, query, request). Order of precedence: PATH (routing placeholders or custom attributes), GET, BODY
public static get ( string $key, mixed $default = null ) : mixed
$key string the key
$default mixed the default value if the parameter key does not exist
리턴 mixed

getAcceptableContentTypes() 공개 정적인 메소드

Gets a list of content types acceptable by the client browser.
public static getAcceptableContentTypes ( ) : array
리턴 array List of content types in preferable order

getBasePath() 공개 정적인 메소드

Suppose that an index.php file instantiates this request object: * http://localhost/index.php returns an empty string * http://localhost/index.php/page returns an empty string * http://localhost/web/index.php returns '/web' * http://localhost/we%20b/index.php returns '/we%20b'
public static getBasePath ( ) : string
리턴 string The raw path (i.e. not urldecoded)

getBaseUrl() 공개 정적인 메소드

The base URL never ends with a /. This is similar to getBasePath(), except that it also includes the script filename (e.g. index.php) if one exists.
public static getBaseUrl ( ) : string
리턴 string The raw URL (i.e. not urldecoded)

getCharsets() 공개 정적인 메소드

Gets a list of charsets acceptable by the client browser.
public static getCharsets ( ) : array
리턴 array List of charsets in preferable order

getClientIp() 공개 정적인 메소드

This method can read the client IP address from the "X-Forwarded-For" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-For" header value is a comma+space separated list of IP addresses, the left-most being the original client, and each successive proxy that passed the request adding the IP address where it received the request from. If your reverse proxy uses a different header name than "X-Forwarded-For", ("Client-Ip" for instance), configure it via "setTrustedHeaderName()" with the "client-ip" key.
또한 보기: getClientIps()
또한 보기: http://en.wikipedia.org/wiki/X-Forwarded-For
public static getClientIp ( ) : string
리턴 string The client IP address

getClientIps() 공개 정적인 메소드

In the returned array the most trusted IP address is first, and the least trusted one last. The "real" client IP address is the last one, but this is also the least trusted one. Trusted proxies are stripped. Use this method carefully; you should use getClientIp() instead.
또한 보기: getClientIp()
public static getClientIps ( ) : array
리턴 array The client IP addresses

getContent() 공개 정적인 메소드

Returns the request body content.
public static getContent ( boolean $asResource = false ) : string | resource
$asResource boolean If true, a resource will be returned
리턴 string | resource The request body content or a resource to read the body stream

getContentType() 공개 정적인 메소드

Gets the format associated with the request.
public static getContentType ( ) : string | null
리턴 string | null The format (null if no content type is present)

getDefaultLocale() 공개 정적인 메소드

Get the default locale.
public static getDefaultLocale ( ) : string
리턴 string

getETags() 공개 정적인 메소드

Gets the Etags.
public static getETags ( ) : array
리턴 array The entity tags

getEncodings() 공개 정적인 메소드

Gets a list of encodings acceptable by the client browser.
public static getEncodings ( ) : array
리턴 array List of encodings in preferable order

getFormat() 공개 정적인 메소드

Gets the format associated with the mime type.
public static getFormat ( string $mimeType ) : string | null
$mimeType string The associated mime type
리턴 string | null The format (null if not found)

getHost() 공개 정적인 메소드

This method can read the client host name from the "X-Forwarded-Host" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-Host" header must contain the client host name. If your reverse proxy uses a different header name than "X-Forwarded-Host", configure it via "setTrustedHeaderName()" with the "client-host" key.
public static getHost ( ) : string
리턴 string

getHttpHost() 공개 정적인 메소드

The port name will be appended to the host if it's non-standard.
public static getHttpHost ( ) : string
리턴 string

getHttpMethodParameterOverride() 공개 정적인 메소드

Checks whether support for the _method request parameter is enabled.
public static getHttpMethodParameterOverride ( ) : boolean
리턴 boolean True when the _method request parameter is enabled, false otherwise

getLanguages() 공개 정적인 메소드

Gets a list of languages acceptable by the client browser.
public static getLanguages ( ) : array
리턴 array Languages ordered in the user browser preferences

getLocale() 공개 정적인 메소드

Get the locale.
public static getLocale ( ) : string
리턴 string

getMethod() 공개 정적인 메소드

If the X-HTTP-Method-Override header is set, and if the method is a POST, then it is used to determine the "real" intended HTTP method. The _method request parameter can also be used to determine the HTTP method, but only if enableHttpMethodParameterOverride() has been called. The method is always an uppercased string.
또한 보기: getRealMethod()
public static getMethod ( ) : string
리턴 string The request method

getMimeType() 공개 정적인 메소드

Gets the mime type associated with the format.
public static getMimeType ( string $format ) : string
$format string The format
리턴 string The associated mime type (null if not found)

getPassword() 공개 정적인 메소드

Returns the password.
public static getPassword ( ) : string | null
리턴 string | null

getPathInfo() 공개 정적인 메소드

The path info always starts with a /. Suppose this request is instantiated from /mysite on localhost: * http://localhost/mysite returns an empty string * http://localhost/mysite/about returns '/about' * http://localhost/mysite/enco%20ded returns '/enco%20ded' * http://localhost/mysite/about?var=1 returns '/about'
public static getPathInfo ( ) : string
리턴 string The raw path (i.e. not urldecoded)

getPort() 공개 정적인 메소드

This method can read the client port from the "X-Forwarded-Port" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-Port" header must contain the client port. If your reverse proxy uses a different header name than "X-Forwarded-Port", configure it via "setTrustedHeaderName()" with the "client-port" key.
public static getPort ( ) : string
리턴 string

getPreferredLanguage() 공개 정적인 메소드

Returns the preferred language.
public static getPreferredLanguage ( array $locales = null ) : string | null
$locales array An array of ordered available locales
리턴 string | null The preferred locale

getQueryString() 공개 정적인 메소드

It builds a normalized query string, where keys/value pairs are alphabetized and have consistent escaping.
public static getQueryString ( ) : string | null
리턴 string | null A normalized query string for the Request

getRealMethod() 공개 정적인 메소드

Gets the "real" request method.
또한 보기: getMethod()
public static getRealMethod ( ) : string
리턴 string The request method

getRelativeUriForPath() 공개 정적인 메소드

Only the URIs path component (no schema, host etc.) is relevant and must be given. Both paths must be absolute and not contain relative parts. Relative URLs from one resource to another are useful when generating self-contained downloadable document archives. Furthermore, they can be used to reduce the link size in documents. Example target paths, given a base path of "/a/b/c/d": - "/a/b/c/d" -> "" - "/a/b/c/" -> "./" - "/a/b/" -> "../" - "/a/b/c/other" -> "other" - "/a/x/y" -> "../../x/y"
public static getRelativeUriForPath ( string $path ) : string
$path string The target path
리턴 string The relative target path

getRequestFormat() 공개 정적인 메소드

Here is the process to determine the format: * format defined by the user (with setRequestFormat()) * _format request attribute * $default
public static getRequestFormat ( string $default = 'html' ) : string
$default string The default format
리턴 string The request format

getRequestUri() 공개 정적인 메소드

Returns the requested URI (path and query string).
public static getRequestUri ( ) : string
리턴 string The raw URI (i.e. not URI decoded)

getRouteResolver() 공개 정적인 메소드

Get the route resolver callback.
public static getRouteResolver ( ) : Closure
리턴 Closure

getScheme() 공개 정적인 메소드

Gets the request's scheme.
public static getScheme ( ) : string
리턴 string

getSchemeAndHttpHost() 공개 정적인 메소드

If the URL was called with basic authentication, the user and the password are not added to the generated string.
public static getSchemeAndHttpHost ( ) : string
리턴 string The scheme and HTTP host

getScriptName() 공개 정적인 메소드

Returns current script name.
public static getScriptName ( ) : string
리턴 string

getSession() 공개 정적인 메소드

Gets the Session.
public static getSession ( ) : Symfony\Component\HttpFoundation\SessionInterface | null
리턴 Symfony\Component\HttpFoundation\SessionInterface | null The session

getTrustedHeaderName() 공개 정적인 메소드

Gets the trusted proxy header name.
public static getTrustedHeaderName ( string $key ) : string
$key string The header key
리턴 string The header name

getTrustedHosts() 공개 정적인 메소드

Gets the list of trusted host patterns.
public static getTrustedHosts ( ) : array
리턴 array An array of trusted host patterns

getTrustedProxies() 공개 정적인 메소드

Gets the list of trusted proxies.
public static getTrustedProxies ( ) : array
리턴 array An array of trusted proxies

getUri() 공개 정적인 메소드

Generates a normalized URI (URL) for the Request.
또한 보기: getQueryString()
public static getUri ( ) : string
리턴 string A normalized URI (URL) for the Request

getUriForPath() 공개 정적인 메소드

Generates a normalized URI for the given path.
public static getUriForPath ( string $path ) : string
$path string A path to use instead of the current one
리턴 string The normalized URI for the path

getUser() 공개 정적인 메소드

Returns the user.
public static getUser ( ) : string | null
리턴 string | null

getUserInfo() 공개 정적인 메소드

Gets the user info.
public static getUserInfo ( ) : string
리턴 string A user name and, optionally, scheme-specific information about how to gain authorization to access the server

getUserResolver() 공개 정적인 메소드

Get the user resolver callback.
public static getUserResolver ( ) : Closure
리턴 Closure

has() 공개 정적인 메소드

Determine if the request contains a non-empty value for an input item.
public static has ( string | array $key ) : boolean
$key string | array
리턴 boolean

hasCookie() 공개 정적인 메소드

Determine if a cookie is set on the request.
public static hasCookie ( string $key ) : boolean
$key string
리턴 boolean

hasFile() 공개 정적인 메소드

Determine if the uploaded data contains a file.
public static hasFile ( string $key ) : boolean
$key string
리턴 boolean

hasHeader() 공개 정적인 메소드

Determine if a header is set on the request.
public static hasHeader ( string $key ) : boolean
$key string
리턴 boolean

hasMacro() 공개 정적인 메소드

Checks if macro is registered.
public static hasMacro ( string $name ) : boolean
$name string
리턴 boolean

hasPreviousSession() 공개 정적인 메소드

Whether the request contains a Session which was started in one of the previous requests.
public static hasPreviousSession ( ) : boolean
리턴 boolean

hasSession() 공개 정적인 메소드

This method does not give any information about the state of the session object, like whether the session is started or not. It is just a way to check if this Request is associated with a Session instance.
public static hasSession ( ) : boolean
리턴 boolean true when the Request contains a Session object, false otherwise

header() 공개 정적인 메소드

Retrieve a header from the request.
public static header ( string $key = null, string | array | null $default = null ) : string | array
$key string
$default string | array | null
리턴 string | array

initialize() 공개 정적인 메소드

This method also re-initializes all properties.
public static initialize ( array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], string | resource $content = null )
$query array The GET parameters
$request array The POST parameters
$attributes array The request attributes (parameters parsed from the PATH_INFO, ...)
$cookies array The COOKIE parameters
$files array The FILES parameters
$server array The SERVER parameters
$content string | resource The raw body data

input() 공개 정적인 메소드

Retrieve an input item from the request.
public static input ( string $key = null, string | array | null $default = null ) : string | array
$key string
$default string | array | null
리턴 string | array

instance() 공개 정적인 메소드

Return the Request instance.
public static instance ( )

intersect() 공개 정적인 메소드

Intersect an array of items with the input data.
public static intersect ( array | mixed $keys ) : array
$keys array | mixed
리턴 array

ip() 공개 정적인 메소드

Returns the client IP address.
public static ip ( ) : string
리턴 string

ips() 공개 정적인 메소드

Returns the client IP addresses.
public static ips ( ) : array
리턴 array

is() 공개 정적인 메소드

Determine if the current request URI matches a pattern.
public static is ( ) : boolean
리턴 boolean

isJson() 공개 정적인 메소드

Determine if the request is sending JSON.
public static isJson ( ) : boolean
리턴 boolean

isMethod() 공개 정적인 메소드

Checks if the request method is of specified type.
public static isMethod ( string $method ) : boolean
$method string Uppercase request method (GET, POST etc)
리턴 boolean

isMethodSafe() 공개 정적인 메소드

Checks whether the method is safe or not.
public static isMethodSafe ( ) : boolean
리턴 boolean

isNoCache() 공개 정적인 메소드

public static isNoCache ( ) : boolean
리턴 boolean

isSecure() 공개 정적인 메소드

This method can read the client protocol from the "X-Forwarded-Proto" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-Proto" header must contain the protocol: "https" or "http". If your reverse proxy uses a different header name than "X-Forwarded-Proto" ("SSL_HTTPS" for instance), configure it via "setTrustedHeaderName()" with the "client-proto" key.
public static isSecure ( ) : boolean
리턴 boolean

isXmlHttpRequest() 공개 정적인 메소드

It works if your JavaScript library sets an X-Requested-With HTTP header. It is known to work with common JavaScript frameworks:
public static isXmlHttpRequest ( ) : boolean
리턴 boolean true if the request is an XMLHttpRequest, false otherwise

json() 공개 정적인 메소드

Get the JSON payload for the request.
public static json ( string $key = null, mixed $default = null ) : mixed
$key string
$default mixed
리턴 mixed

macro() 공개 정적인 메소드

Register a custom macro.
public static macro ( string $name, callable $macro ) : void
$name string
$macro callable
리턴 void

matchesType() 공개 정적인 메소드

Determine if the given content types match.
public static matchesType ( string $actual, string $type ) : boolean
$actual string
$type string
리턴 boolean

merge() 공개 정적인 메소드

Merge new input into the current request's input array.
public static merge ( array $input ) : void
$input array
리턴 void

method() 공개 정적인 메소드

Get the request method.
public static method ( ) : string
리턴 string

normalizeQueryString() 공개 정적인 메소드

It builds a normalized query string, where keys/value pairs are alphabetized, have consistent escaping and unneeded delimiters are removed.
public static normalizeQueryString ( string $qs ) : string
$qs string Query string
리턴 string A normalized query string for the Request

offsetExists() 공개 정적인 메소드

Determine if the given offset exists.
public static offsetExists ( string $offset ) : boolean
$offset string
리턴 boolean

offsetGet() 공개 정적인 메소드

Get the value at the given offset.
public static offsetGet ( string $offset ) : mixed
$offset string
리턴 mixed

offsetSet() 공개 정적인 메소드

Set the value at the given offset.
public static offsetSet ( string $offset, mixed $value ) : void
$offset string
$value mixed
리턴 void

offsetUnset() 공개 정적인 메소드

Remove the value at the given offset.
public static offsetUnset ( string $offset ) : void
$offset string
리턴 void

old() 공개 정적인 메소드

Retrieve an old input item.
public static old ( string $key = null, string | array | null $default = null ) : string | array
$key string
$default string | array | null
리턴 string | array

only() 공개 정적인 메소드

Get a subset of the items from the input data.
public static only ( array | mixed $keys ) : array
$keys array | mixed
리턴 array

overrideGlobals() 공개 정적인 메소드

It overrides $_GET, $_POST, $_REQUEST, $_SERVER, $_COOKIE. $_FILES is never overridden, see rfc1867
public static overrideGlobals ( )

path() 공개 정적인 메소드

Get the current path info for the request.
public static path ( ) : string
리턴 string

pjax() 공개 정적인 메소드

Determine if the request is the result of an PJAX call.
public static pjax ( ) : boolean
리턴 boolean

prefers() 공개 정적인 메소드

Return the most suitable content type from the given array based on content negotiation.
public static prefers ( string | array $contentTypes ) : string | null
$contentTypes string | array
리턴 string | null

query() 공개 정적인 메소드

Retrieve a query string item from the request.
public static query ( string $key = null, string | array | null $default = null ) : string | array
$key string
$default string | array | null
리턴 string | array

replace() 공개 정적인 메소드

Replace the input for the current request.
public static replace ( array $input ) : void
$input array
리턴 void

root() 공개 정적인 메소드

Get the root URL for the application.
public static root ( ) : string
리턴 string

route() 공개 정적인 메소드

Get the route handling the request.
public static route ( string | null $param = null ) : Illuminate\Routing\Route | object | string
$param string | null
리턴 Illuminate\Routing\Route | object | string

secure() 공개 정적인 메소드

Determine if the request is over HTTPS.
public static secure ( ) : boolean
리턴 boolean

segment() 공개 정적인 메소드

Get a segment from the URI (1 based index).
public static segment ( integer $index, string | null $default = null ) : string | null
$index integer
$default string | null
리턴 string | null

segments() 공개 정적인 메소드

Get all of the segments for the request path.
public static segments ( ) : array
리턴 array

server() 공개 정적인 메소드

Retrieve a server variable from the request.
public static server ( string $key = null, string | array | null $default = null ) : string | array
$key string
$default string | array | null
리턴 string | array

session() 공개 정적인 메소드

Get the session associated with the request.
public static session ( ) : Illuminate\Session\Store
리턴 Illuminate\Session\Store

setDefaultLocale() 공개 정적인 메소드

Sets the default locale.
public static setDefaultLocale ( string $locale )
$locale string

setFactory() 공개 정적인 메소드

This is mainly useful when you need to override the Request class to keep BC with an existing system. It should not be used for any other purpose.
public static setFactory ( callable | null $callable )
$callable callable | null A PHP callable

setFormat() 공개 정적인 메소드

Associates a format with mime types.
public static setFormat ( string $format, string | array $mimeTypes )
$format string The format
$mimeTypes string | array The associated mime types (the preferred one must be the first as it will be used as the content type)

setLocale() 공개 정적인 메소드

Sets the locale.
public static setLocale ( string $locale )
$locale string

setMethod() 공개 정적인 메소드

Sets the request method.
public static setMethod ( string $method )
$method string

setRequestFormat() 공개 정적인 메소드

Sets the request format.
public static setRequestFormat ( string $format )
$format string The request format

setRouteResolver() 공개 정적인 메소드

Set the route resolver callback.
public static setRouteResolver ( Closure $callback )
$callback Closure

setSession() 공개 정적인 메소드

Sets the Session.
public static setSession ( Symfony\Component\HttpFoundation\SessionInterface $session )
$session Symfony\Component\HttpFoundation\SessionInterface The Session

setTrustedHeaderName() 공개 정적인 메소드

The following header keys are supported: * Request::HEADER_CLIENT_IP: defaults to X-Forwarded-For (see getClientIp()) * Request::HEADER_CLIENT_HOST: defaults to X-Forwarded-Host (see getHost()) * Request::HEADER_CLIENT_PORT: defaults to X-Forwarded-Port (see getPort()) * Request::HEADER_CLIENT_PROTO: defaults to X-Forwarded-Proto (see getScheme() and isSecure()) Setting an empty value allows to disable the trusted header for the given key.
public static setTrustedHeaderName ( string $key, string $value )
$key string The header key
$value string The header name

setTrustedHosts() 공개 정적인 메소드

You should only list the hosts you manage using regexs.
public static setTrustedHosts ( array $hostPatterns )
$hostPatterns array A list of trusted host patterns

setTrustedProxies() 공개 정적인 메소드

You should only list the reverse proxies that you manage directly.
public static setTrustedProxies ( array $proxies )
$proxies array A list of trusted proxies

setUserResolver() 공개 정적인 메소드

Set the user resolver callback.
public static setUserResolver ( Closure $callback )
$callback Closure

toArray() 공개 정적인 메소드

Get all of the input and files for the request.
public static toArray ( ) : array
리턴 array

url() 공개 정적인 메소드

Get the URL (no query string) for the request.
public static url ( ) : string
리턴 string

user() 공개 정적인 메소드

Get the user making the request.
public static user ( string | null $guard = null ) : mixed
$guard string | null
리턴 mixed

wantsJson() 공개 정적인 메소드

Determine if the current request is asking for JSON in return.
public static wantsJson ( ) : boolean
리턴 boolean