当时已经解决了,就是使用mysql最新5.7版本就好了,mariadb最新版本不行,都试过了,就直接用mysql
没有,vote和关注功能都是好的,代码没有改过,就是直接粘过来,桉视频的改,gulp,现在去掉了props里的值,就跟视频中gulp后一样了,难道跟windows有关么
额,看到console中大概意思是值被重写了,想到去掉props的值,就跟视频中一样了,为什么群主的没有出现这个问题呢,google了没有看到有效的回答[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "count"
额,群主我gulp后,“关注”这个之前做的vue看不到了,点赞出了问题。。。
(found in <UserFollowButton> at C:\laragon\www\xy\resources\assets\js\components\UserFollowButton.vue)
群主加油,一直在等着,最初会犯一些burden的错误,但感觉好像这也是一个过程。。该去续充会员了=。=
没事,解决了==
站长可以贴一下show.blade.php的代码么,当我提交答案后,“x个答案”这里样式改变了,增添了a标签,同时下划线的样式也没有了,有对照视频中的样式,这种问题这两天一直出。。。
额,已经弄了一个下午,'question_id'的值就是存储不到数据库中。关于migration,我已经看了上一个视频,一 一对照了并且重新生成了一遍,数据库也重启了,fillable里面的值确认了,google后把config / database.php文件的连接设置'strict'=> false。我dd($request->all(),$question)可以收到$question的值,'question_id' => $question,一直有问题。
如果是站长,会再往哪去看,会是原因呢?已经抓狂了。。。。麻烦了
更新一下问题,SQLSTATE[HY000]: General error: 1364 Field 'question_id' doesn't have a default value (SQL: insert into answers
(user_id
, body
, updated_at
, created_at
) values (6,
23
, 2017-03-01 15:06:25, 2017-03-01 15:06:25))
但是比如我的url为http://localhost:8000/questions/12,我dd一下,结果是"12",$question是有值得啊
你好,SQLSTATE[HY000]: General error: 1364 Field 'question_id' doesn't have a default value (SQL: insert into answers
,
我的代码部分:
public function store(Request $request,$question)
{
$answer=$this->answer->create([
'question_id'=>$question,
'user_id'=>Auth::id(),
'body'=>$request->get('body')
]);
$answer->question()->increment('answers_count');
return back();
}
之前dd也是有值得,却说值没有传进来。。
dd($question);
也是传过来的