From 3ce9bb09b78ea1fac22b7f2ff2295bcb2be8588e Mon Sep 17 00:00:00 2001 From: Kyrch Date: Tue, 22 Oct 2024 12:10:44 -0300 Subject: [PATCH] feat: introducing flexible cache to improve performance (#754) --- .env.example | 2 + .env.example-sail | 2 + .../DiscordVideoNotificationAction.php | 2 +- .../List/BaseStoreExternalProfileAction.php | 19 +- .../Anime/ApiAction/AnilistAnimeApiAction.php | 5 +- .../Anime/ApiAction/JikanAnimeApiAction.php | 5 +- .../ApiAction/LivechartAnimeApiAction.php | 3 +- .../Anime/ApiAction/MalAnimeApiAction.php | 3 +- app/Actions/Models/Wiki/ApiAction.php | 6 +- .../Studio/ApiAction/MalStudioApiAction.php | 3 +- .../Wiki/Video/UploadVideoTableAction.php | 8 +- app/Filament/Tabs/BaseTab.php | 9 +- app/Filament/Widgets/BaseChartWidget.php | 13 +- app/Models/Admin/ActionLog.php | 4 +- app/Models/Admin/FeaturedTheme.php | 6 +- app/Models/Auth/User.php | 6 +- app/Models/Discord/DiscordThread.php | 2 +- app/Models/List/External/ExternalEntry.php | 4 +- app/Models/List/External/ExternalToken.php | 2 +- app/Models/List/ExternalProfile.php | 8 +- app/Models/List/Playlist.php | 10 +- app/Models/List/Playlist/PlaylistTrack.php | 10 +- app/Models/Wiki/Anime.php | 16 +- app/Models/Wiki/Anime/AnimeSynonym.php | 2 +- app/Models/Wiki/Anime/AnimeTheme.php | 8 +- .../Wiki/Anime/Theme/AnimeThemeEntry.php | 4 +- app/Models/Wiki/Artist.php | 10 +- app/Models/Wiki/Audio.php | 2 +- app/Models/Wiki/ExternalResource.php | 8 +- app/Models/Wiki/Group.php | 4 +- app/Models/Wiki/Image.php | 8 +- app/Models/Wiki/Series.php | 2 +- app/Models/Wiki/Song.php | 6 +- app/Models/Wiki/Studio.php | 6 +- app/Models/Wiki/Video.php | 8 +- app/Models/Wiki/Video/VideoScript.php | 2 +- app/Pivots/List/PlaylistImage.php | 4 +- app/Pivots/Wiki/AnimeImage.php | 4 +- app/Pivots/Wiki/AnimeResource.php | 4 +- app/Pivots/Wiki/AnimeSeries.php | 4 +- app/Pivots/Wiki/AnimeStudio.php | 4 +- app/Pivots/Wiki/AnimeThemeEntryVideo.php | 4 +- app/Pivots/Wiki/ArtistImage.php | 4 +- app/Pivots/Wiki/ArtistMember.php | 4 +- app/Pivots/Wiki/ArtistResource.php | 4 +- app/Pivots/Wiki/ArtistSong.php | 4 +- app/Pivots/Wiki/SongResource.php | 4 +- app/Pivots/Wiki/StudioImage.php | 4 +- app/Pivots/Wiki/StudioResource.php | 4 +- composer.json | 1 + composer.lock | 656 +++++++++++------- config/debugbar.php | 329 +++++++++ public/vendor/telescope/app.js | 2 +- public/vendor/telescope/mix-manifest.json | 2 +- storage/debugbar/.gitignore | 2 + 55 files changed, 889 insertions(+), 373 deletions(-) create mode 100644 config/debugbar.php create mode 100644 storage/debugbar/.gitignore diff --git a/.env.example b/.env.example index 9a3469610..6777b0270 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,8 @@ API_URL= APP_NAME=AnimeThemes APP_ENV=local APP_DEBUG=true +DEBUGBAR_ENABLED=true +DEBUGBAR_EDITOR= APP_URL=http://localhost ASSET_URL=null APP_KEY= diff --git a/.env.example-sail b/.env.example-sail index 1cfc59b0a..c50fe70ec 100644 --- a/.env.example-sail +++ b/.env.example-sail @@ -6,6 +6,8 @@ API_URL= APP_NAME=AnimeThemes APP_ENV=local APP_DEBUG=true +DEBUGBAR_ENABLED=true +DEBUGBAR_EDITOR= APP_URL=http://localhost ASSET_URL=null APP_KEY= diff --git a/app/Actions/Discord/DiscordVideoNotificationAction.php b/app/Actions/Discord/DiscordVideoNotificationAction.php index 85aa0a373..dd4bec2b2 100644 --- a/app/Actions/Discord/DiscordVideoNotificationAction.php +++ b/app/Actions/Discord/DiscordVideoNotificationAction.php @@ -65,7 +65,7 @@ class DiscordVideoNotificationAction Arr::set($videoArray, Video::ATTRIBUTE_OVERLAP, $video->overlap->localize()); Arr::set($videoArray, 'animethemeentries.0.animetheme.type', $theme->type->localize()); - foreach ($videoArray['animethemeentries.0.animetheme.anime.images'] as $key => $image) { + foreach (Arr::get($videoArray, 'animethemeentries.0.animetheme.anime.images') as $key => $image) { Arr::set($videoArray, "animethemeentries.0.animetheme.anime.images.$key.facet", $anime->images->get($key)->facet->localize()); } diff --git a/app/Actions/Models/List/BaseStoreExternalProfileAction.php b/app/Actions/Models/List/BaseStoreExternalProfileAction.php index d843f6a65..4f4c0e56c 100644 --- a/app/Actions/Models/List/BaseStoreExternalProfileAction.php +++ b/app/Actions/Models/List/BaseStoreExternalProfileAction.php @@ -9,6 +9,7 @@ use App\Models\Wiki\Anime; use App\Models\Wiki\ExternalResource; use Illuminate\Support\Arr; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Cache; /** * Class BaseStoreExternalProfileAction. @@ -22,18 +23,18 @@ abstract class BaseStoreExternalProfileAction * * @param ExternalProfileSite $profileSite * @param array $entries - * @return void + * @return void */ protected function preloadResources(ExternalProfileSite $profileSite, array $entries): void { - $externalResources = ExternalResource::query() - ->where(ExternalResource::ATTRIBUTE_SITE, $profileSite->getResourceSite()->value) - ->whereIn(ExternalResource::ATTRIBUTE_EXTERNAL_ID, Arr::pluck($entries, 'external_id')) - ->with(ExternalResource::RELATION_ANIME) - ->get() - ->mapWithKeys(fn (ExternalResource $resource) => [$resource->external_id => $resource->anime]); - - $this->resources = $externalResources; + $this->resources = Cache::flexible("externalprofile_resources", [60, 300], function () use ($profileSite, $entries) { + return ExternalResource::query() + ->where(ExternalResource::ATTRIBUTE_SITE, $profileSite->getResourceSite()->value) + ->whereIn(ExternalResource::ATTRIBUTE_EXTERNAL_ID, Arr::pluck($entries, 'external_id')) + ->with(ExternalResource::RELATION_ANIME) + ->get() + ->mapWithKeys(fn (ExternalResource $resource) => [$resource->external_id => $resource->anime]); + }); } /** diff --git a/app/Actions/Models/Wiki/Anime/ApiAction/AnilistAnimeApiAction.php b/app/Actions/Models/Wiki/Anime/ApiAction/AnilistAnimeApiAction.php index 88ae8926a..2633ca3c4 100644 --- a/app/Actions/Models/Wiki/Anime/ApiAction/AnilistAnimeApiAction.php +++ b/app/Actions/Models/Wiki/Anime/ApiAction/AnilistAnimeApiAction.php @@ -8,6 +8,7 @@ use App\Actions\Models\Wiki\ApiAction; use App\Enums\Models\Wiki\AnimeSynonymType; use App\Enums\Models\Wiki\ImageFacet; use App\Enums\Models\Wiki\ResourceSite; +use App\Models\Wiki\Anime; use App\Models\Wiki\ExternalResource; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Support\Arr; @@ -31,7 +32,7 @@ class AnilistAnimeApiAction extends ApiAction /** * Set the response after the request. * - * @param BelongsToMany $resources + * @param BelongsToMany $resources * @return static */ public function handle(BelongsToMany $resources): static @@ -127,7 +128,7 @@ class AnilistAnimeApiAction extends ApiAction /** * Get the available sites to backfill. - * + * * @return array */ protected function getResourcesMapping(): array diff --git a/app/Actions/Models/Wiki/Anime/ApiAction/JikanAnimeApiAction.php b/app/Actions/Models/Wiki/Anime/ApiAction/JikanAnimeApiAction.php index 1652280de..a3f9a12b5 100644 --- a/app/Actions/Models/Wiki/Anime/ApiAction/JikanAnimeApiAction.php +++ b/app/Actions/Models/Wiki/Anime/ApiAction/JikanAnimeApiAction.php @@ -6,6 +6,7 @@ namespace App\Actions\Models\Wiki\Anime\ApiAction; use App\Actions\Models\Wiki\ApiAction; use App\Enums\Models\Wiki\ResourceSite; +use App\Models\Wiki\Anime; use App\Models\Wiki\ExternalResource; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Support\Arr; @@ -29,7 +30,7 @@ class JikanAnimeApiAction extends ApiAction /** * Set the response after the request. * - * @param BelongsToMany $resources + * @param BelongsToMany $resources * @return static */ public function handle(BelongsToMany $resources): static @@ -78,7 +79,7 @@ class JikanAnimeApiAction extends ApiAction /** * Get the available sites to backfill. - * + * * @return array */ protected function getResourcesMapping(): array diff --git a/app/Actions/Models/Wiki/Anime/ApiAction/LivechartAnimeApiAction.php b/app/Actions/Models/Wiki/Anime/ApiAction/LivechartAnimeApiAction.php index 517fcd3f9..5b81eb12c 100644 --- a/app/Actions/Models/Wiki/Anime/ApiAction/LivechartAnimeApiAction.php +++ b/app/Actions/Models/Wiki/Anime/ApiAction/LivechartAnimeApiAction.php @@ -6,6 +6,7 @@ namespace App\Actions\Models\Wiki\Anime\ApiAction; use App\Actions\Models\Wiki\ApiAction; use App\Enums\Models\Wiki\ResourceSite; +use App\Models\Wiki\Anime; use App\Models\Wiki\ExternalResource; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Support\Facades\Http; @@ -28,7 +29,7 @@ class LivechartAnimeApiAction extends ApiAction /** * Set the response after the request. * - * @param BelongsToMany $resources + * @param BelongsToMany $resources * @return static */ public function handle(BelongsToMany $resources): static diff --git a/app/Actions/Models/Wiki/Anime/ApiAction/MalAnimeApiAction.php b/app/Actions/Models/Wiki/Anime/ApiAction/MalAnimeApiAction.php index 4511cb0f3..dca074f1a 100644 --- a/app/Actions/Models/Wiki/Anime/ApiAction/MalAnimeApiAction.php +++ b/app/Actions/Models/Wiki/Anime/ApiAction/MalAnimeApiAction.php @@ -6,6 +6,7 @@ namespace App\Actions\Models\Wiki\Anime\ApiAction; use App\Actions\Models\Wiki\ApiAction; use App\Enums\Models\Wiki\ResourceSite; +use App\Models\Wiki\Anime; use App\Models\Wiki\ExternalResource; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Support\Arr; @@ -30,7 +31,7 @@ class MalAnimeApiAction extends ApiAction /** * Set the response after the request. * - * @param BelongsToMany $resources + * @param BelongsToMany $resources * @return static */ public function handle(BelongsToMany $resources): static diff --git a/app/Actions/Models/Wiki/ApiAction.php b/app/Actions/Models/Wiki/ApiAction.php index 7ec26e886..c24cac19b 100644 --- a/app/Actions/Models/Wiki/ApiAction.php +++ b/app/Actions/Models/Wiki/ApiAction.php @@ -5,7 +5,11 @@ declare(strict_types=1); namespace App\Actions\Models\Wiki; use App\Enums\Models\Wiki\ResourceSite; +use App\Models\BaseModel; +use App\Models\Wiki\Anime; use App\Models\Wiki\ExternalResource; +use App\Models\Wiki\Studio; +use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Support\Arr; @@ -39,7 +43,7 @@ abstract class ApiAction /** * Set the response after the request. * - * @param BelongsToMany $resources + * @param BelongsToMany $resources * @return static */ abstract public function handle(BelongsToMany $resources): static; diff --git a/app/Actions/Models/Wiki/Studio/ApiAction/MalStudioApiAction.php b/app/Actions/Models/Wiki/Studio/ApiAction/MalStudioApiAction.php index d10f79477..d8de13b5a 100644 --- a/app/Actions/Models/Wiki/Studio/ApiAction/MalStudioApiAction.php +++ b/app/Actions/Models/Wiki/Studio/ApiAction/MalStudioApiAction.php @@ -8,6 +8,7 @@ use App\Actions\Models\Wiki\ApiAction; use App\Enums\Models\Wiki\ImageFacet; use App\Enums\Models\Wiki\ResourceSite; use App\Models\Wiki\ExternalResource; +use App\Models\Wiki\Studio; use Illuminate\Database\Eloquent\Relations\BelongsToMany; /** @@ -28,7 +29,7 @@ class MalStudioApiAction extends ApiAction /** * Set the response after the request. * - * @param BelongsToMany $resources + * @param BelongsToMany $resources * @return static */ public function handle(BelongsToMany $resources): static diff --git a/app/Filament/TableActions/Storage/Wiki/Video/UploadVideoTableAction.php b/app/Filament/TableActions/Storage/Wiki/Video/UploadVideoTableAction.php index f7fa59478..b75da7125 100644 --- a/app/Filament/TableActions/Storage/Wiki/Video/UploadVideoTableAction.php +++ b/app/Filament/TableActions/Storage/Wiki/Video/UploadVideoTableAction.php @@ -128,15 +128,15 @@ class UploadVideoTableAction extends UploadTableAction ->label(__('filament.fields.video.overlap.name')) ->helperText(__('filament.fields.video.overlap.help')) ->options(VideoOverlap::asSelectArray()) - ->nullable() - ->rules(['nullable', new Enum(VideoOverlap::class)]), + ->required() + ->rules(['required', new Enum(VideoOverlap::class)]), Select::make(Video::ATTRIBUTE_SOURCE) ->label(__('filament.fields.video.source.name')) ->helperText(__('filament.fields.video.source.help')) ->options(VideoSource::asSelectArray()) - ->nullable() - ->rules(['nullable', new Enum(VideoSource::class)]), + ->required() + ->rules(['required', new Enum(VideoSource::class)]), ], ) ), diff --git a/app/Filament/Tabs/BaseTab.php b/app/Filament/Tabs/BaseTab.php index 891a15085..ad1012254 100644 --- a/app/Filament/Tabs/BaseTab.php +++ b/app/Filament/Tabs/BaseTab.php @@ -6,6 +6,7 @@ namespace App\Filament\Tabs; use Filament\Resources\Components\Tab; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Support\Facades\Cache; /** * Class BaseTab. @@ -41,7 +42,9 @@ abstract class BaseTab extends Tab */ public function modifyQuery(Builder $query): Builder { - return $this->modifyQuery($query); + return Cache::flexible("filament_query_{$this->getKey()}", [15, 60], function () use ($query) { + return $this->modifyQuery($query); + }); } /** @@ -51,7 +54,9 @@ abstract class BaseTab extends Tab */ public function getBadge(): int { - return $this->getBadge(); + return Cache::flexible("filament_badge_{$this->getKey()}", [15, 60], function () { + return $this->getBadge(); + }); } /** diff --git a/app/Filament/Widgets/BaseChartWidget.php b/app/Filament/Widgets/BaseChartWidget.php index 03d307766..609740660 100644 --- a/app/Filament/Widgets/BaseChartWidget.php +++ b/app/Filament/Widgets/BaseChartWidget.php @@ -6,6 +6,7 @@ namespace App\Filament\Widgets; use Flowframe\Trend\Trend; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Cache; use Leandrocfe\FilamentApexCharts\Widgets\ApexChartWidget; /** @@ -17,16 +18,18 @@ class BaseChartWidget extends ApexChartWidget /** * Get the resources count created per month. - * + * * @param class-string $model * @return Collection */ protected function perMonth(string $model): Collection { - return Trend::model($model) - ->between(now()->addMonths(-11)->startOfMonth(), now()->endOfMonth()) - ->perMonth() - ->count(); + return Cache::flexible("filament_chart_$model", [300, 1200], function () use ($model) { + return Trend::model($model) + ->between(now()->addMonths(-11)->startOfMonth(), now()->endOfMonth()) + ->perMonth() + ->count(); + }); } /** diff --git a/app/Models/Admin/ActionLog.php b/app/Models/Admin/ActionLog.php index 2b92b7a8d..f3d9608e6 100644 --- a/app/Models/Admin/ActionLog.php +++ b/app/Models/Admin/ActionLog.php @@ -20,7 +20,7 @@ use Throwable; /** * Class ActionLog. - * + * * @property int $id * @property string $batch_id * @property string $name @@ -145,7 +145,7 @@ class ActionLog extends Model implements Nameable, HasSubtitle /** * Get the user that initiated the action. * - * @return BelongsTo + * @return BelongsTo */ public function user(): BelongsTo { diff --git a/app/Models/Admin/FeaturedTheme.php b/app/Models/Admin/FeaturedTheme.php index c5b7fbeed..c207bd8a8 100644 --- a/app/Models/Admin/FeaturedTheme.php +++ b/app/Models/Admin/FeaturedTheme.php @@ -134,7 +134,7 @@ class FeaturedTheme extends BaseModel /** * Get the user that recommended the featured theme. * - * @return BelongsTo + * @return BelongsTo */ public function user(): BelongsTo { @@ -144,7 +144,7 @@ class FeaturedTheme extends BaseModel /** * Get the entry for the featured video. * - * @return BelongsTo + * @return BelongsTo */ public function animethemeentry(): BelongsTo { @@ -154,7 +154,7 @@ class FeaturedTheme extends BaseModel /** * Get the video to feature. * - * @return BelongsTo + * @return BelongsTo */ public function video(): BelongsTo { diff --git a/app/Models/Auth/User.php b/app/Models/Auth/User.php index 4db96d21f..c7dee21b4 100644 --- a/app/Models/Auth/User.php +++ b/app/Models/Auth/User.php @@ -221,7 +221,7 @@ class User extends Authenticatable implements MustVerifyEmail, Nameable, HasSubt /** * Get the playlists that belong to the user. * - * @return HasMany + * @return HasMany */ public function playlists(): HasMany { @@ -231,7 +231,7 @@ class User extends Authenticatable implements MustVerifyEmail, Nameable, HasSubt /** * Get the playlists that belong to the user. * - * @return HasMany + * @return HasMany */ public function externalprofiles(): HasMany { @@ -241,7 +241,7 @@ class User extends Authenticatable implements MustVerifyEmail, Nameable, HasSubt /** * Get the action logs that the user has executed. * - * @return HasMany + * @return HasMany */ public function actionlogs(): HasMany { diff --git a/app/Models/Discord/DiscordThread.php b/app/Models/Discord/DiscordThread.php index 7f8bec1de..2c5d0efc9 100644 --- a/app/Models/Discord/DiscordThread.php +++ b/app/Models/Discord/DiscordThread.php @@ -105,7 +105,7 @@ class DiscordThread extends BaseModel /** * Gets the anime that the thread uses. * - * @return BelongsTo + * @return BelongsTo */ public function anime(): BelongsTo { diff --git a/app/Models/List/External/ExternalEntry.php b/app/Models/List/External/ExternalEntry.php index 4e9da52e4..a9a13b5c2 100644 --- a/app/Models/List/External/ExternalEntry.php +++ b/app/Models/List/External/ExternalEntry.php @@ -133,7 +133,7 @@ class ExternalEntry extends BaseModel /** * Get the anime that owns the user external entry. * - * @return BelongsTo + * @return BelongsTo */ public function anime(): BelongsTo { @@ -143,7 +143,7 @@ class ExternalEntry extends BaseModel /** * Get the user profile that owns the user profile. * - * @return BelongsTo + * @return BelongsTo */ public function externalprofile(): BelongsTo { diff --git a/app/Models/List/External/ExternalToken.php b/app/Models/List/External/ExternalToken.php index bb2c02b11..8cfca12b3 100644 --- a/app/Models/List/External/ExternalToken.php +++ b/app/Models/List/External/ExternalToken.php @@ -118,7 +118,7 @@ class ExternalToken extends BaseModel /** * Get the external profile that owns the external token. * - * @return BelongsTo + * @return BelongsTo */ public function externalprofile(): BelongsTo { diff --git a/app/Models/List/ExternalProfile.php b/app/Models/List/ExternalProfile.php index 7f9626fcb..3c3e377fc 100644 --- a/app/Models/List/ExternalProfile.php +++ b/app/Models/List/ExternalProfile.php @@ -38,7 +38,7 @@ use Illuminate\Support\Facades\Date; * @property int|null $user_id * @property User|null $user * @property ExternalProfileVisibility $visibility - * + * * @method static ExternalProfileFactory factory(...$parameters) */ class ExternalProfile extends BaseModel @@ -190,7 +190,7 @@ class ExternalProfile extends BaseModel /** * Get the entries for the profile. * - * @return HasMany + * @return HasMany */ public function externalentries(): HasMany { @@ -200,7 +200,7 @@ class ExternalProfile extends BaseModel /** * Get the user that owns the profile. * - * @return BelongsTo + * @return BelongsTo */ public function user(): BelongsTo { @@ -210,7 +210,7 @@ class ExternalProfile extends BaseModel /** * Get the external token that the external profile owns. * - * @return HasOne + * @return HasOne */ public function externaltoken(): HasOne { diff --git a/app/Models/List/Playlist.php b/app/Models/List/Playlist.php index 7ff09ec69..055cc6c4e 100644 --- a/app/Models/List/Playlist.php +++ b/app/Models/List/Playlist.php @@ -175,7 +175,7 @@ class Playlist extends BaseModel implements HasHashids, Viewable /** * Get the user that owns the playlist. * - * @return BelongsTo + * @return BelongsTo */ public function user(): BelongsTo { @@ -185,7 +185,7 @@ class Playlist extends BaseModel implements HasHashids, Viewable /** * Get the first track of the playlist. * - * @return BelongsTo + * @return BelongsTo */ public function first(): BelongsTo { @@ -195,7 +195,7 @@ class Playlist extends BaseModel implements HasHashids, Viewable /** * Get the last track of the playlist. * - * @return BelongsTo + * @return BelongsTo */ public function last(): BelongsTo { @@ -205,7 +205,7 @@ class Playlist extends BaseModel implements HasHashids, Viewable /** * Get the images for the playlist. * - * @return BelongsToMany + * @return BelongsToMany */ public function images(): BelongsToMany { @@ -218,7 +218,7 @@ class Playlist extends BaseModel implements HasHashids, Viewable /** * Get the tracks that comprise the playlist. * - * @return HasMany + * @return HasMany */ public function tracks(): HasMany { diff --git a/app/Models/List/Playlist/PlaylistTrack.php b/app/Models/List/Playlist/PlaylistTrack.php index 30958913c..6e10171fd 100644 --- a/app/Models/List/Playlist/PlaylistTrack.php +++ b/app/Models/List/Playlist/PlaylistTrack.php @@ -156,7 +156,7 @@ class PlaylistTrack extends BaseModel implements HasHashids /** * Get the entry of the track. * - * @return BelongsTo + * @return BelongsTo */ public function animethemeentry(): BelongsTo { @@ -166,7 +166,7 @@ class PlaylistTrack extends BaseModel implements HasHashids /** * Get the playlist the track belongs to. * - * @return BelongsTo + * @return BelongsTo */ public function playlist(): BelongsTo { @@ -176,7 +176,7 @@ class PlaylistTrack extends BaseModel implements HasHashids /** * Get the previous track. * - * @return BelongsTo + * @return BelongsTo */ public function previous(): BelongsTo { @@ -186,7 +186,7 @@ class PlaylistTrack extends BaseModel implements HasHashids /** * Get the next track. * - * @return BelongsTo + * @return BelongsTo */ public function next(): BelongsTo { @@ -196,7 +196,7 @@ class PlaylistTrack extends BaseModel implements HasHashids /** * Get the video of the track. * - * @return BelongsTo + * @return BelongsTo */ public function video(): BelongsTo { diff --git a/app/Models/Wiki/Anime.php b/app/Models/Wiki/Anime.php index 67d11024a..1b22deed8 100644 --- a/app/Models/Wiki/Anime.php +++ b/app/Models/Wiki/Anime.php @@ -199,7 +199,7 @@ class Anime extends BaseModel /** * Get the synonyms for the anime. * - * @return HasMany + * @return HasMany */ public function animesynonyms(): HasMany { @@ -209,7 +209,7 @@ class Anime extends BaseModel /** * Get the discord thread that the anime owns. * - * @return HasOne + * @return HasOne */ public function discordthread(): HasOne { @@ -219,7 +219,7 @@ class Anime extends BaseModel /** * Get the series the anime is included in. * - * @return BelongsToMany + * @return BelongsToMany */ public function series(): BelongsToMany { @@ -232,7 +232,7 @@ class Anime extends BaseModel /** * Get the themes for the anime. * - * @return HasMany + * @return HasMany */ public function animethemes(): HasMany { @@ -242,7 +242,7 @@ class Anime extends BaseModel /** * Get the resources for the anime. * - * @return BelongsToMany + * @return BelongsToMany */ public function resources(): BelongsToMany { @@ -256,7 +256,7 @@ class Anime extends BaseModel /** * Get the images for the anime. * - * @return BelongsToMany + * @return BelongsToMany */ public function images(): BelongsToMany { @@ -269,7 +269,7 @@ class Anime extends BaseModel /** * Get the studios that produced the anime. * - * @return BelongsToMany + * @return BelongsToMany */ public function studios(): BelongsToMany { @@ -282,7 +282,7 @@ class Anime extends BaseModel /** * Get the entries for the anime. * - * @return HasMany + * @return HasMany */ public function externalentries(): HasMany { diff --git a/app/Models/Wiki/Anime/AnimeSynonym.php b/app/Models/Wiki/Anime/AnimeSynonym.php index 6d5e89a9a..8bcb3f3ef 100644 --- a/app/Models/Wiki/Anime/AnimeSynonym.php +++ b/app/Models/Wiki/Anime/AnimeSynonym.php @@ -114,7 +114,7 @@ class AnimeSynonym extends BaseModel /** * Gets the anime that owns the synonym. * - * @return BelongsTo + * @return BelongsTo */ public function anime(): BelongsTo { diff --git a/app/Models/Wiki/Anime/AnimeTheme.php b/app/Models/Wiki/Anime/AnimeTheme.php index 56179633d..54258be2f 100644 --- a/app/Models/Wiki/Anime/AnimeTheme.php +++ b/app/Models/Wiki/Anime/AnimeTheme.php @@ -178,7 +178,7 @@ class AnimeTheme extends BaseModel /** * Gets the anime that owns the theme. * - * @return BelongsTo + * @return BelongsTo */ public function anime(): BelongsTo { @@ -188,7 +188,7 @@ class AnimeTheme extends BaseModel /** * Gets the group that the theme uses. * - * @return BelongsTo + * @return BelongsTo */ public function group(): BelongsTo { @@ -198,7 +198,7 @@ class AnimeTheme extends BaseModel /** * Gets the song that the theme uses. * - * @return BelongsTo + * @return BelongsTo */ public function song(): BelongsTo { @@ -208,7 +208,7 @@ class AnimeTheme extends BaseModel /** * Get the entries for the theme. * - * @return HasMany + * @return HasMany */ public function animethemeentries(): HasMany { diff --git a/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php b/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php index 7712da6d7..05dbad38c 100644 --- a/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php +++ b/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php @@ -178,7 +178,7 @@ class AnimeThemeEntry extends BaseModel /** * Get the theme that owns the entry. * - * @return BelongsTo + * @return BelongsTo */ public function animetheme(): BelongsTo { @@ -188,7 +188,7 @@ class AnimeThemeEntry extends BaseModel /** * Get the videos linked in the theme entry. * - * @return BelongsToMany