本文整理汇总了PHP中Illuminate\Http\Request::getQueryString方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::getQueryString方法的具体用法?PHP Request::getQueryString怎么用?PHP Request::getQueryString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Http\Request
的用法示例。
在下文中一共展示了Request::getQueryString方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUrl
/**
* Return current url
*
* @return string
*/
protected function getUrl()
{
$url = '/' . $this->request->path();
$queryString = $this->request->getQueryString();
if ($queryString) {
$url .= '?' . $queryString;
}
return $url;
}
示例2: index
public function index(Request $request)
{
$filter = $request->except(['orderBy']);
$limit = $request->get('limit', 20);
$item_status = array_get($request->all(), 'item_status', array());
$orderBy = array_get($request->all(), 'sort_by', array());
$items = RequesitionItem::whereByFilter($filter, $limit, $orderBy);
return view('requesitionMovements.index', ['items' => $items, 'filter' => $filter, 'urlExport' => url("/requesition-movement/download-excel?{$request->getQueryString()}"), 'item_status' => $item_status]);
}
示例3: getUrl
/**
* Return current url
*
* @return string
*/
protected function getUrl()
{
$url = $this->request->path();
if (!starts_with($url, '/')) {
$url = '/' . $url;
}
$queryString = $this->request->getQueryString();
if ($queryString) {
$url .= '?' . $queryString;
}
return $url;
}
示例4: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (!\Snowfire::isRequestFromSnowfire() && !config('snowfire.debug')) {
return \Response::make('Please request this url from a Snowfire component', 500);
}
$accountsRepository = app()->make('\\Snowfire\\App\\Repositories\\AccountsRepository');
if (config('snowfire.debug')) {
// In debug mode, use the first account id
$app = $accountsRepository->first();
} else {
// Load Snowfire account based on URL
parse_str($request->getQueryString(), $query);
$app = $accountsRepository->getByKey($query['key']);
}
app()->make('view')->composer('*', function ($view) use($app) {
$view->snowfire = $app;
});
app()->instance('snowfire', $app);
return $next($request);
}
示例5: getQueryString
/**
* Generates the normalized query string for the Request.
*
* It builds a normalized query string, where keys/value pairs are alphabetized
* and have consistent escaping.
*
* @return string|null A normalized query string for the Request
* @static
*/
public static function getQueryString()
{
//Method inherited from \Symfony\Component\HttpFoundation\Request
return \Illuminate\Http\Request::getQueryString();
}
示例6: getBaseUrl
private function getBaseUrl(Request $request)
{
return str_replace('?' . $request->getQueryString(), '', $request->getUri());
}
示例7: loadScripts
public function loadScripts(Request $request)
{
info('Load script: ' . $request->getQueryString());
$this->runScript('wp-admin/load-scripts.php');
}
示例8: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
$this->request->accId = $request->input('accid');
$this->request->timestamp = $request->input('timestamp');
$this->request->hmac = $request->input('hmac');
$this->request->authorizationCode = $request->input('code');
$this->request->authorizationState = $request->input('state');
$this->request->queryString = $request->getQueryString();
$this->session->accId = $request->session()->get('mailium_app_user_accid', null);
$this->session->authorizationState = $request->session()->get('mailium_authorization_state', null);
$isOauthValid = null;
$isTokenValid = null;
$verifyHmac = $this->request->accId && $this->request->hmac && $this->request->timestamp;
if ($verifyHmac) {
$isHmacValid = $this->mailiumOauthClient->verifyHmac($this->request->queryString, config('mailium-oauth.client_secret'));
if ($isHmacValid) {
$this->setUser($this->request->accId);
} else {
return response('not authorized, HMAC validation failed', 401);
}
} else {
if ($this->session->accId) {
$this->setUser($this->session->accId);
} else {
// we don't have a user
}
}
// If this is an authorization request
if ($this->request->authorizationCode && $verifyHmac) {
// Check Authorization State
if ($this->request->authorizationState == $this->session->authorizationState) {
// Get access token
$this->mailiumOauthClient->authorize($this->request->authorizationCode);
$this->user = call_user_func([$this->model, 'getByAccId'], $this->request->accId);
$this->mailium_app_just_installed = true;
$request->session()->forget('mailium_authorization_state');
} else {
$request->session()->flush();
return $this->redirectForAuthorization($request);
}
}
// find out if this is an uninstall webhook request
$uriSegments = $request->segments();
$isUninstallWebhook = last($uriSegments) === 'uninstall';
$userExists = $this->user;
$shouldValidateOauth = $verifyHmac;
// validate oauth only if this is a hmac request (to prevent oauth validation on every request)
if ($userExists && $shouldValidateOauth && !$isUninstallWebhook) {
// Be sure that the access token works and oauth tokens are valid
$isOauthValid = $this->mailiumOauthClient->validateOauth($this->user->getOauthTokens());
$isTokenValid = $this->mailiumOauthClient->verifyToken($this->user->getAccessToken());
if (!$isTokenValid || !$isOauthValid) {
$this->user->oauth_tokens = new \stdClass();
$this->user->save();
}
}
// If we still don't have a correlating app user then we haven't seen this user before, go to authorization url
if ($this->user) {
$isOauthValid = $this->mailiumOauthClient->validateOauth($this->user->getOauthTokens());
if (!$isOauthValid) {
return $this->redirectForAuthorization($request);
}
} else {
return $this->redirectForAuthorization($request);
}
// From here on we are sure that we have a valid app user
$request->session()->set('mailium_app_user_accid', $this->user->accid);
$request->session()->forget('mailium_authorization_state');
$this->mailiumOauthClient->setToken($this->user->getOauthTokens());
$apiClient = new MailiumAPI3('', $this->user->getAccessToken(), '', 'json');
// Add attributes to request
$request->attributes->add(['mailium_app_accid' => $this->user->accid, 'mailium_app_user' => $this->user, 'mailium_app_just_installed' => $this->mailium_app_just_installed, 'mailium_api_client' => $apiClient]);
return $next($request);
}
示例9: index
public function index(Request $request)
{
$filter = $request->all();
$receives = Receive::whereByFilterAll($filter);
return view('receives.index', ['receives' => $receives, 'urlDownloadExcel' => url("/receives/download-excel?{$request->getQueryString()}")]);
}
示例10: talk
public function talk(Request $request)
{
UpdateLog::create(['body' => $request->getContent() ?: '', 'query' => $request->getQueryString() ?: '']);
}
示例11: handle
/**
* @param Store $session
* @param Request $request
*/
public function handle(Store $session, Request $request)
{
$session->set('table::' . $request->url(), $request->getQueryString());
}
示例12: custom
public function custom(Request $request)
{
$query = $request->getQueryString();
parse_str($query, $query_array);
return view('admin.pages.reports.custom', compact('query_array'));
}
示例13: makeCacheKey
protected function makeCacheKey(Request $request)
{
return 'route_' . str_slug($request->path() . $request->getQueryString());
}
示例14: getUrl
/**
* @return string
*/
public function getUrl()
{
$query = $this->request->getQueryString();
return '/' . trim($this->request->path(), '/') . ($query ? '?' . $query : '');
}