2017-08-16 75 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無法處理,我已經更新和正常工作。

解決替換ì爲í。

相關問題