【发布时间】:2019-10-02 02:00:05
【问题描述】:
基本上,当我尝试为我的数据库创建一个新条目时,我会收到此错误。我几乎所有其他关于此事的文章都是真实的,但还没有找到错误/问题。我的代码就是这样;
$userId = DB::table(\Config::get('constants.DB_MAIN_DATABASE') . '.users')->insertGetId(
[
'email' => $input['email'],
'name' => $input['name'],
'mobile_no' => $input['mobile_no'],
'interest' => $input['interest'] ? implode(',', $input['interest']) : null,
'interest_other' => $input['interest_other'] ? $input['interest_other'] : null,
'password' => bcrypt($input['password']),
'verified' => 0,
'admin' => 0,
'token' => str_random(30),
'created_at' => date('Y-m-d H:i:s'),
]);
dd($userId);
请注意,我什至无法访问我的 dd。值是这样的;
$input['email'] = "Prawn@abc.com"
$input['name'] = "Udh N"
$input['mobile_no'] = "0123456789"
$input['interest'] = "1"
$input['interest_other'] = "2"
$input['password'] = "password"
这里有什么问题吗?
【问题讨论】:
-
发生在哪一行?
-
它说 Response.php 第 399 行?但我什至没有对此添加回复..
-
你能提供一个堆栈跟踪吗?
-
如果你注释掉这两行,你会得到同样的错误吗?
-
一旦我将
'interest'和'interest_other'设置为空,它就起作用了。但如果我使用上面显示的方式,它就不起作用。奇数...
标签: laravel