2017-08-16 28 views
0

方法“布尔”:响应内容必须是字符串或对象实施__toString()给出

public function users(){ 
    $users = User::with(['profile'])->customer()->get(); 
    return Response::json($users); 
} 

响应:

响应内容必须是字符串或对象实施__toString(),给出“布尔”。

* @return $this 
* 
* @throws \UnexpectedValueException 
*/ 

public function setContent($content) 
    { 
     if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable(array($content, '__toString'))) { 
      throw new \UnexpectedValueException(sprintf('The Response content must be a string or object implementing __toString(), "%s" given.', gettype($content))); 
    } 

什么即时做错了?我读过一些类似的问题,但我无法找到错误或任何解决方案。

此致敬礼!

+0

即时通讯使用laravel 4.2 – uruapanmexicansong

+1

什么时候你dd($用户)之前返回什么? – MMMTroy

+1

你想收到什么? – milo526

回答

0

令人难以置信的是,你不会相信...用户有一个口音,utf8_decode无法处理,我已经更新和正常工作。

解决替换ì为í。

相关问题