我試圖作爲一個正常的獲取數據,但在圖像領域的JSON響應顯示錯誤。下面的代碼是正確的?下面的代碼如何從流明API中的數據庫中獲取圖像?
public function up()
{
Schema::create('admin', function (Blueprint $table) {
$table->increments('id');
$table->string('username');
$table->string('password');
$table->string('profile_pic');
});
和獲取數據
public function log() {
$users = AdminLogin::all();
return response()->json($users);
}
問題尋求幫助調試(「爲什麼不是這個代碼的工作?」)必須包括所期望的行爲,一個具體問題或錯誤,在問題本身中重現它所需的最短代碼。沒有明確問題陳述的問題對其他讀者無益。請參閱:如何創建[mcve]。使用「編輯」鏈接來改善你的*問題* - 不要通過評論添加更多信息。謝謝! – GhostCat