我正在使用Sentinel为我的评分系统项目进行身份验证,并添加了社交网络系统和高级身份验证系统等功能,我的问题是:
$post = new Post;
$post->title=$request->title;
$post->body=$request->body;
$post->user_id = auth()->user()->id; //need to convert into a cartalyst way
$post->save();发布于 2018-01-24 16:02:55
在模型中建立关系,然后使用attach()函数将用户附加到帖子以获取更多信息请查看Laravel Docs [https://laravel.com/docs/5.5/eloquent-relationships]
https://stackoverflow.com/questions/48417418
复制相似问题