本文整理汇总了PHP中Illuminate\Http\Response::content方法的典型用法代码示例。如果您正苦于以下问题:PHP Response::content方法的具体用法?PHP Response::content怎么用?PHP Response::content使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Http\Response
的用法示例。
在下文中一共展示了Response::content方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkAuth
/**
* Check the results of the authorization attempt, and return the appropriate response.
*
* @param JsonResponse|Response $auth
* @return JsonResponse|Response
*/
private function checkAuth($auth)
{
$data = json_decode($auth->content());
$response = '';
if (isset($data->error)) {
// An error was returned, so let's send it back to the user
$errors = new MessageBag([$data->error => [$data->message]]);
$response = redirect()->back()->withErrors($errors);
} elseif (isset($data->jwtoken)) {
// A JWT was returned, so let's use it to run the postLogin function
$response = $this->userAuth->postLogin($data->jwtoken);
} else {
// Something is awry, so let's abort
abort(501);
}
return $response;
}
示例2: restCall
/**
* @param $method
* @param $uri
* @param $parameters
* @return Response
*/
protected function restCall($method, $uri = '', $parameters = [])
{
$this->httpResponse = $this->actingAs(User::fetch($this->userId))->call($method, $uri, $parameters);
return Response::jsonDeserialize($this->httpResponse->content());
}