Skip to content

Commit

Permalink
Laravel 11 (#1201)
Browse files Browse the repository at this point in the history
* wip

* chore: fix carbon3 breaking changes

* build: upgrade schema
  • Loading branch information
iBotPeaches authored Mar 24, 2024
1 parent d71b092 commit e7259b3
Show file tree
Hide file tree
Showing 6 changed files with 453 additions and 490 deletions.
4 changes: 2 additions & 2 deletions app/Models/MedalAnalytic.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public static function purgeSeason(Medal $medal, ?Season $season = null): void
$query->delete();
}

public function getTimePlayedAttribute(): int
public function getTimePlayedAttribute(): float
{
return now()->addSeconds($this->total_seconds_played)->diffInHours();
return now()->addSeconds($this->total_seconds_played)->diffInHours(absolute: true);
}

public function medal(): BelongsTo
Expand Down
4 changes: 2 additions & 2 deletions app/Models/ServiceRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ public function getAverageScoreAttribute(): float
return $this->total_score / $this->total_matches;
}

public function getTimePlayedAttribute(): int
public function getTimePlayedAttribute(): float
{
return now()->addSeconds($this->total_seconds_played)->diffInHours();
return now()->addSeconds($this->total_seconds_played)->diffInHours(absolute: true);
}

public function getWinPercentColorAttribute(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function property(): string

public function displayProperty(Analytic $analytic): string
{
return number_format(now()->addSeconds((int) $analytic->value)->diffInHours());
return number_format(now()->addSeconds((int) $analytic->value)->diffInHours(absolute: true));
}

public function results(int $limit = 10): ?Collection
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
"doctrine/dbal": "^3.2",
"guzzlehttp/guzzle": "^7.4",
"jaybizzle/laravel-crawler-detect": "^1.3",
"laravel/framework": "^10.0",
"laravel/framework": "^11.0",
"laravel/horizon": "^v5.15.0",
"laravel/sanctum": "^3.2",
"laravel/socialite": "^5.5",
"laravel/tinker": "^2.5",
"league/csv": "^9.8",
Expand All @@ -24,7 +23,7 @@
"fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.5",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
"nunomaduro/collision": "^8.1",
"larastan/larastan": "2.9.2",
"phpunit/phpunit": "^10.0",
"spatie/laravel-ignition": "^2.0"
Expand Down
Loading

0 comments on commit e7259b3

Please sign in to comment.