【发布时间】:2017-04-05 16:52:23
【问题描述】:
我的配置文件夹中有一个 messages 文件
'msg_log' => [
'created' => 'created successfully',
'not_created' => 'not created',
] 我在 DB 中有一个表作为 messages 有两个字段作为 type 如果它已创建或未创建,则应该在哪里创建,其他字段是 msg强>应该去消息 如何从控制器中的存储方法将其保存到我的消息表中
public function store(Request $request)
{
$data['email'] = $request->input('email');
$data['password'] = bcrypt($request->input('password'));
$user = User::create($data);
if($user->id) {
// If Created Here
}else{
// Not created
}
请告诉我如何在 if else 中将 type 和 msg 保存在消息表中 谢谢
【问题讨论】:
-
你的配置文件名是什么?可能是this可以帮助你。
-
我收到消息但不知道如何将上面创建的
'created' => 'created successfully',存储在数据库中意味着已经成功创建没有创建关键字 -
配置文件名为messages.php