【发布时间】:2017-11-05 14:15:55
【问题描述】:
我有这个错误的问题:
https://pastebin.com/cgm5yq0P
这是我的表格:
https://pastebin.com/bSU5X5EC
这是我的 web.php(路由控制器):
Route::post('/komentarz', 'VideosController@postComment');
这是我的 VideoController postComment 功能:
https://pastebin.com/SYbEjB8H
这是我的评论模型:
https://pastebin.com/SxHX6gTP
这是我的用户模型 cmets 函数:
public function comments() {
return $this->hasMany('App\Comment');
}
这是我的视频模型 cmets 函数:
public function comments(){
return $this->belongsToMany('App\Comment')->withTimestamps();
}
最后,名为 create_cmets_table 的迁移文件:
https://pastebin.com/2cHscQfq
我的路线:
https://pastebin.com/ki8FZ0C6
请帮我解决这个问题。我不知道出了什么问题
【问题讨论】: