JellyBool

17773 经验值

这个显示不出来的时候,console 是什么错?

额,你的是什么操作系统?你对 git 和 ssh 是什么样程度的了解?

这个方法:

public function isVoted($answer_id)
    {
        $count = $this->votes()->where('answer_id', $answer_id)->count();
        if ($count > 0){
            $this->votes()->find($answer_id)->increment('votes_count');
            return true;
        }
        return false;
    }

跟点赞数增加或者减少不应该有任何的关系啊

$this->votes()->find($answer_id)->increment('votes_count');

这个删掉就好了吧。

vagrant box list
这样就可以看到你的 box 了。

你照着这个文档看一下:https://laravel.com/docs/5.4/homestead#first-steps

上面的操作步骤

很正常吧,这个逻辑:

 $count = $this->votes()->where('answer_id', $answer_id)->count();
        if ($count > 0){
            $this->votes()->find($answer_id)->increment('votes_count');
            return true;
        }

没有的,都是想看视频的人跟着视频多敲代码

学,不学 python 就学 go!

我的个人意见!我最初只是接触过 python 。