namespace IlluminateHttp;
use Closure;
use ArrayAccess;
use SplFileInfo;
use RuntimeException;
use IlluminateSupportArr;
use IlluminateSupportStr;
use IlluminateSupportTraitsMacroable;
use IlluminateContractsSupportArrayable;
use SymfonyComponentHttpFoundationParameterBag;
use SymfonyComponentHttpFoundationRequest as SymfonyRequest;
// long namespace
class Request extends SymfonyRequest implements Arrayable, ArrayAccess
{// Request
use Macroable;// use trait
protected $json;// The decoded JSON content for the request.
protected $convertedFiles;//converted file
protected $userResolver;//The user resolver callback.
protected $routeResolver;// The route resolver callback.
public static function capture()
{
static::enableHttpMethodParameterOverride();// static::
return static::createFrombase(SymfonyRequest::createFromGlobals());
}// Create a new Illuminate HTTP request from server variables.
public function instance()
{
return $this;
}//Return the Request instance
public function method()
{
return $this->getMethod();
}// get the request method.
public function root()
{
return rtrim($this->getSchemeAndHttpHost().$this->getbaseUrl(), '/');
}// Get the root URL for the application.
public function url()
{
return rtrim(preg_replace('/?.*/', '', $this->getUri()), '/');
}// Get the URL (no query string) for the request.
public function fullUrl()
{
$query = $this->getQueryString();// query ,get Query String
$question = $this->getbaseUrl().$this->getPathInfo() == '/' ? '/?' : '?';// question
return $query ? $this->url().$question.$query : $this->url();// query
}// Get the full URL for the request.
public function path()
{
$pattern = trim($this->getPathInfo(), '/');
return $pattern == '' ? '/' : $pattern;
}//get Path
public function decodedPath()
{
return rawurldecode($this->path());
}//decode Path get the path
public function segment($index, $default = null)
{
return Arr::get($this->segments(), $index - 1, $default);
}//Get a segment from the URI (1 based index).
public function segments()
{
$segments = explode('/', $this->path());
return array_values(array_filter($segments, function ($v) {
return $v != '';
}));// array_values.
}// Get all of the segments for the request path
public function is()
{
foreach (func_get_args() as $pattern) {
if (Str::is($pattern, urldecode($this->path()))) {
return true;
}
}
return false;
}// check current request.



