我必须要教室和地位。我想在状态表中插入课堂ID。我的控制器:
$userStatus = new Status();
$userStatus -> status_text = $text;
$userStatus -> video_url = $request['video_url'];
$userStatus -> type = 2;
$userStatus -> users_id = Auth::user()->id;
$userStatus -> save();
Flash::success('Your status has been posted');
return redirect(route('class'));
如果我想插入类ID应该做什么?
答案 0 :(得分:0)
哪个类ID来自?
否则你可以添加这一行:
$userStatus -> class_id = 2;