將我的Laravel應用程序從MySQL移動到pSQL。我不斷收到這個錯誤。響應內容必須是一個字符串或實現__toString(),「boolean」後移動到psql的對象
響應內容必須是實現__toString(),「boolean」給定的字符串或對象。
我有想回到我的推廣
http://localhost:8888/api/promotion/1
public function id($id){
$promotion = Promotion::find($id);
dd($promotion); //I got something here
return $promotion;
}
它用於返回我的推廣,現在它返回一個錯誤的API。
dd($ promotion);
I got
Promotion {#410 ▼
#table: "promotions"
#connection: null
#primaryKey: "id"
#perPage: 15
+incrementing: true
+timestamps: true
#attributes: array:16 [▼
"id" => 1
"cpe_mac" => "000D6721A5EE"
"name" => "qwrqwer"
"type" => "img_path"
"status" => "Active"
"heading_text" => "qwerq"
"body_text" => "werqwerqw"
"img" => stream resource @244 ▶}
"img_path" => "/images/promotion/1/promotion.png"
"video_url" => ""
"video_path" => ""
"account_id" => 1001
"img_url" => ""
"footer_text" => "qwerqwerre"
"created_at" => "2016-08-04 10:53:57"
"updated_at" => "2016-08-04 10:53:59"
]
#original: array:16 [▶]
#relations: []
#hidden: []
#visible: []
#appends: []
#fillable: []
#guarded: array:1 [▶]
#dates: []
#dateFormat: null
#casts: []
#touches: []
#observables: []
#with: []
#morphClass: null
+exists: true
+wasRecentlyCreated: false
}
內容
__ 任何提示/這個建議,將是一個巨大的幫助!
您的意思是postgresql? Psql是客戶端noh的名稱? – middlestump