Cannot save avg using updateOrCreate Method.

Posted 5 months ago by anonymouse703

Hello everyone I cannot save avg in user table.. and there's no error in Log file.. What do I missed?

    public function changeRate(Request $request, $id){
        $rate = new Rating();
        $rate->user_id = $id;
        $rate->rating = $request->rating;

        $rateUser = DB::table('rating')
                ->where('user_id', $id)


when I tried to return the $id and $userRate I have this result.


id: "2"

rateUser: "3.2222"

Please sign in or create an account to participate in this conversation.