What is wrong with him? Here is the error:
Undefined property: Illuminate\Database\Eloquent\Collection::$id That's what swears:
public static function _getUserChanceOfGame($user, $game1x1) { $chance = 0; if (!is_null($user)) { $bet = Bet_1x1::where('game_id', $game1x1->id) ->where('user_id', $user->id) // Ругается сюда ->sum('price'); if ($bet == 0) { $chance = 0; } else { $chance = round($bet / $game1x1->price, 3) * 100; } } return $chance; } If something else needs to be thrown off, I will throw it off.