本文整理汇总了PHP中Illuminate\Support\Facades\Request::replace方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::replace方法的具体用法?PHP Request::replace怎么用?PHP Request::replace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Request
的用法示例。
在下文中一共展示了Request::replace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$request = Request::create('/api/blocknotify', 'GET', ['key' => Mint\Settings::getVal('api_key'), 'blockhash' => $this->argument('blockhash')]);
Request::replace($request->input());
$response = Route::dispatch($request)->getContent();
if ($this->option('debug')) {
$this->info($response);
}
}
示例2: initPaging
public function initPaging()
{
$request = Request::all();
$tableState = json_decode($request["tableState"]);
if ($tableState->pagination) {
$perPage = !empty($tableState->pagination->number) ? $tableState->pagination->number : 20;
Request::replace(['page' => round($tableState->pagination->start / $perPage + 1)]);
$this->perPage = $perPage;
}
}
示例3: dispatch
/**
* Dispatch this request.
*
* @param string $method
*
* @return mixed
*/
public function dispatch($method)
{
// Save original input.
$original_input = Request::input();
// Create request.
$request = Request::create($this->uri, $method, $this->params);
// Replace input (maintain api auth parameters).
Request::replace(array_merge($request->input(), array('client_id' => Request::input('client_id'), 'client_secret' => Request::input('client_secret'), 'access_token' => Request::input('access_token'))));
// Dispatch request.
$response = Route::dispatch($request);
// Restore original input.
Request::replace($original_input);
$content = $response->getContent();
return empty($content) ? null : json_decode($response->getContent(), true);
}