'boolean']; protected static function boot(): void { parent::boot(); static::saved(function (Review $review) { $review->game->recalculateRating(); }); static::deleted(function (Review $review) { $review->game->recalculateRating(); }); static::created(function (Review $review) { ActivityService::log($review->user, 'reviewed_game', $review->game, ['rating' => $review->rating]); }); } public function user(): BelongsTo { return $this->belongsTo(User::class); } public function game(): BelongsTo { return $this->belongsTo(Game::class); } public function votes(): HasMany { return $this->hasMany(ReviewVote::class); } }