Skip to content

Commit

Permalink
feat: laravel 11 (#727)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyrch authored Aug 19, 2024
1 parent 13f6b23 commit 70d3253
Show file tree
Hide file tree
Showing 36 changed files with 1,291 additions and 1,069 deletions.
4 changes: 2 additions & 2 deletions app/Filament/Widgets/Auth/UserChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class UserChart extends BaseChartWidget
/**
* Chart Id.
*
* @var string
* @var string|null
*/
protected static string $chartId = 'userChart';
protected static ?string $chartId = 'userChart';

/**
* Get the displayed label of the widget.
Expand Down
4 changes: 2 additions & 2 deletions app/Filament/Widgets/List/ExternalProfileChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class ExternalProfileChart extends BaseChartWidget
/**
* Chart Id.
*
* @var string
* @var string|null
*/
protected static string $chartId = 'externalProfileChart';
protected static ?string $chartId = 'externalProfileChart';

/**
* Get the displayed label of the widget.
Expand Down
4 changes: 2 additions & 2 deletions app/Filament/Widgets/List/PlaylistChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class PlaylistChart extends BaseChartWidget
/**
* Chart Id.
*
* @var string
* @var string|null
*/
protected static string $chartId = 'playlistChart';
protected static ?string $chartId = 'playlistChart';

/**
* Get the displayed label of the widget.
Expand Down
4 changes: 2 additions & 2 deletions app/Filament/Widgets/List/PlaylistTrackChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class PlaylistTrackChart extends BaseChartWidget
/**
* Chart Id.
*
* @var string
* @var string|null
*/
protected static string $chartId = 'trackChart';
protected static ?string $chartId = 'trackChart';

/**
* Get the displayed label of the widget.
Expand Down
4 changes: 2 additions & 2 deletions app/Filament/Widgets/Wiki/Anime/AnimeChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class AnimeChart extends BaseChartWidget
/**
* Chart Id.
*
* @var string
* @var string|null
*/
protected static string $chartId = 'animeChart';
protected static ?string $chartId = 'animeChart';

/**
* Get the displayed label of the widget.
Expand Down
4 changes: 2 additions & 2 deletions app/Filament/Widgets/Wiki/Artist/ArtistChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class ArtistChart extends BaseChartWidget
/**
* Chart Id.
*
* @var string
* @var string|null
*/
protected static string $chartId = 'artistChart';
protected static ?string $chartId = 'artistChart';

/**
* Get the displayed label of the widget.
Expand Down
4 changes: 2 additions & 2 deletions app/Filament/Widgets/Wiki/Series/SeriesChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class SeriesChart extends BaseChartWidget
/**
* Chart Id.
*
* @var string
* @var string|null
*/
protected static string $chartId = 'seriesChart';
protected static ?string $chartId = 'seriesChart';

/**
* Get the displayed label of the widget.
Expand Down
4 changes: 2 additions & 2 deletions app/Filament/Widgets/Wiki/Video/VideoChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class VideoChart extends BaseChartWidget
/**
* Chart Id.
*
* @var string
* @var string|null
*/
protected static string $chartId = 'videoChart';
protected static ?string $chartId = 'videoChart';

/**
* Get the displayed label of the widget.
Expand Down
1 change: 1 addition & 0 deletions app/Http/Api/Schema/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public function relation(string $path): ?Schema
{
$relationInclude = Arr::first($this->allowedIncludes(), fn (AllowedInclude $include) => $include->path() === $path);

/** @phpstan-ignore-next-line */
return $relationInclude?->schema();
}
}
21 changes: 12 additions & 9 deletions app/Models/Admin/ActionLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,6 @@ class ActionLog extends Model implements Nameable, HasSubtitle
ActionLog::ATTRIBUTE_FINISHED_AT,
];

/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
ActionLog::ATTRIBUTE_STATUS => ActionLogStatus::class,
];

/**
* The table associated with the model.
*
Expand All @@ -106,6 +97,18 @@ class ActionLog extends Model implements Nameable, HasSubtitle
*/
protected $primaryKey = ActionLog::ATTRIBUTE_ID;

/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
ActionLog::ATTRIBUTE_STATUS => ActionLogStatus::class,
];
}

/**
* Get name.
*
Expand Down
15 changes: 9 additions & 6 deletions app/Models/Admin/FeaturedTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,17 @@ class FeaturedTheme extends BaseModel
protected $primaryKey = FeaturedTheme::ATTRIBUTE_ID;

/**
* The attributes that should be cast.
* Get the attributes that should be cast.
*
* @var array<string, string>
* @return array<string, string>
*/
protected $casts = [
FeaturedTheme::ATTRIBUTE_END_AT => 'datetime',
FeaturedTheme::ATTRIBUTE_START_AT => 'datetime',
];
protected function casts(): array
{
return [
FeaturedTheme::ATTRIBUTE_END_AT => 'datetime',
FeaturedTheme::ATTRIBUTE_START_AT => 'datetime',
];
}

/**
* Get name.
Expand Down
15 changes: 9 additions & 6 deletions app/Models/Auth/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ class Role extends BaseRole
final public const RELATION_USERS = 'users';

/**
* The attributes that should be cast.
* Get the attributes that should be cast.
*
* @var array<string, string>
* @return array<string, string>
*/
protected $casts = [
Role::ATTRIBUTE_DEFAULT => 'boolean',
Role::ATTRIBUTE_PRIORITY => 'int',
];
protected function casts(): array
{
return [
Role::ATTRIBUTE_DEFAULT => 'boolean',
Role::ATTRIBUTE_PRIORITY => 'int',
];
}
}
15 changes: 9 additions & 6 deletions app/Models/Auth/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,17 @@ class User extends Authenticatable implements MustVerifyEmail, Nameable, HasSubt
protected $dateFormat = 'Y-m-d\TH:i:s.u';

/**
* The attributes that should be cast.
* Get the attributes that should be cast.
*
* @var array<string, string>
* @return array<string, string>
*/
protected $casts = [
User::ATTRIBUTE_EMAIL_VERIFIED_AT => 'datetime',
User::ATTRIBUTE_PASSWORD => 'hashed',
];
protected function casts(): array
{
return [
User::ATTRIBUTE_EMAIL_VERIFIED_AT => 'datetime',
User::ATTRIBUTE_PASSWORD => 'hashed',
];
}

/**
* Get name.
Expand Down
15 changes: 9 additions & 6 deletions app/Models/List/External/ExternalEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,17 @@ class ExternalEntry extends BaseModel
protected $primaryKey = ExternalEntry::ATTRIBUTE_ID;

/**
* The attributes that should be cast.
* Get the attributes that should be cast.
*
* @var array<string, string>
* @return array<string, string>
*/
protected $casts = [
ExternalEntry::ATTRIBUTE_IS_FAVORITE => 'bool',
ExternalEntry::ATTRIBUTE_WATCH_STATUS => ExternalEntryWatchStatus::class,
];
protected function casts(): array
{
return [
ExternalEntry::ATTRIBUTE_IS_FAVORITE => 'bool',
ExternalEntry::ATTRIBUTE_WATCH_STATUS => ExternalEntryWatchStatus::class,
];
}

/**
* Get name.
Expand Down
15 changes: 9 additions & 6 deletions app/Models/List/ExternalProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,17 @@ class ExternalProfile extends BaseModel
protected $primaryKey = ExternalProfile::ATTRIBUTE_ID;

/**
* The attributes that should be cast.
* Get the attributes that should be cast.
*
* @var array<string, string>
* @return array<string, string>
*/
protected $casts = [
ExternalProfile::ATTRIBUTE_SITE => ExternalProfileSite::class,
ExternalProfile::ATTRIBUTE_VISIBILITY => ExternalProfileVisibility::class,
];
protected function casts(): array
{
return [
ExternalProfile::ATTRIBUTE_SITE => ExternalProfileSite::class,
ExternalProfile::ATTRIBUTE_VISIBILITY => ExternalProfileVisibility::class,
];
}

/**
* Get name.
Expand Down
13 changes: 8 additions & 5 deletions app/Models/List/Playlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,16 @@ public function getRouteKeyName(): string
}

/**
* The attributes that should be cast.
* Get the attributes that should be cast.
*
* @var array<string, string>
* @return array<string, string>
*/
protected $casts = [
Playlist::ATTRIBUTE_VISIBILITY => PlaylistVisibility::class,
];
protected function casts(): array
{
return [
Playlist::ATTRIBUTE_VISIBILITY => PlaylistVisibility::class,
];
}

/**
* Get the numbers used to encode the model's hashids.
Expand Down
17 changes: 10 additions & 7 deletions app/Models/Wiki/Anime.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,18 @@ public function getRouteKeyName(): string
}

/**
* The attributes that should be cast.
* Get the attributes that should be cast.
*
* @var array<string, string>
* @return array<string, string>
*/
protected $casts = [
Anime::ATTRIBUTE_SEASON => AnimeSeason::class,
Anime::ATTRIBUTE_YEAR => 'int',
Anime::ATTRIBUTE_MEDIA_FORMAT => AnimeMediaFormat::class
];
protected function casts(): array
{
return [
Anime::ATTRIBUTE_SEASON => AnimeSeason::class,
Anime::ATTRIBUTE_YEAR => 'int',
Anime::ATTRIBUTE_MEDIA_FORMAT => AnimeMediaFormat::class,
];
}

/**
* Get name.
Expand Down
13 changes: 8 additions & 5 deletions app/Models/Wiki/Anime/AnimeSynonym.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,16 @@ class AnimeSynonym extends BaseModel
protected $primaryKey = AnimeSynonym::ATTRIBUTE_ID;

/**
* The attributes that should be cast.
* Get the attributes that should be cast.
*
* @var array<string, string>
* @return array<string, string>
*/
protected $casts = [
AnimeSynonym::ATTRIBUTE_TYPE => AnimeSynonymType::class,
];
protected function casts(): array
{
return [
AnimeSynonym::ATTRIBUTE_TYPE => AnimeSynonymType::class,
];
}

/**
* Get name.
Expand Down
15 changes: 9 additions & 6 deletions app/Models/Wiki/Anime/AnimeTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,17 @@ public function toSearchableArray(): array
}

/**
* The attributes that should be cast.
* Get the attributes that should be cast.
*
* @var array<string, string>
* @return array<string, string>
*/
protected $casts = [
AnimeTheme::ATTRIBUTE_SEQUENCE => 'int',
AnimeTheme::ATTRIBUTE_TYPE => ThemeType::class,
];
protected function casts(): array
{
return [
AnimeTheme::ATTRIBUTE_SEQUENCE => 'int',
AnimeTheme::ATTRIBUTE_TYPE => ThemeType::class,
];
}

/**
* Get name.
Expand Down
17 changes: 10 additions & 7 deletions app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,18 @@ class AnimeThemeEntry extends BaseModel
protected $primaryKey = AnimeThemeEntry::ATTRIBUTE_ID;

/**
* The attributes that should be cast.
* Get the attributes that should be cast.
*
* @var array<string, string>
* @return array<string, string>
*/
protected $casts = [
AnimeThemeEntry::ATTRIBUTE_NSFW => 'boolean',
AnimeThemeEntry::ATTRIBUTE_SPOILER => 'boolean',
AnimeThemeEntry::ATTRIBUTE_VERSION => 'int',
];
protected function casts(): array
{
return [
AnimeThemeEntry::ATTRIBUTE_NSFW => 'boolean',
AnimeThemeEntry::ATTRIBUTE_SPOILER => 'boolean',
AnimeThemeEntry::ATTRIBUTE_VERSION => 'int',
];
}

/**
* Modify the query used to retrieve models when making all of the models searchable.
Expand Down
13 changes: 8 additions & 5 deletions app/Models/Wiki/Audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,16 @@ public function getRouteKeyName(): string
}

/**
* The attributes that should be cast.
* Get the attributes that should be cast.
*
* @var array<string, string>
* @return array<string, string>
*/
protected $casts = [
Audio::ATTRIBUTE_SIZE => 'int',
];
protected function casts(): array
{
return [
Audio::ATTRIBUTE_SIZE => 'int',
];
}

/**
* Get name.
Expand Down
Loading

0 comments on commit 70d3253

Please sign in to comment.