diff --git a/.env.example b/.env.example index 15bb2ad14..c16e470f9 100644 --- a/.env.example +++ b/.env.example @@ -269,6 +269,7 @@ ANILIST_CLIENT_SECRET=null ANILIST_REDIRECT_URI=null # session +SESSION_COOKIE=animethemes_session SESSION_DRIVER=database SESSION_LIFETIME=120 SESSION_CONNECTION=null diff --git a/.env.example-sail b/.env.example-sail index d8f9e87b2..a68889143 100644 --- a/.env.example-sail +++ b/.env.example-sail @@ -267,6 +267,7 @@ ANILIST_CLIENT_SECRET=null ANILIST_REDIRECT_URI=null # session +SESSION_COOKIE=animethemes_session SESSION_DRIVER=database SESSION_LIFETIME=120 SESSION_CONNECTION=null diff --git a/app/Actions/Models/List/External/Entry/Claimed/AnilistExternalEntryClaimedAction.php b/app/Actions/Models/List/External/Entry/Claimed/AnilistExternalEntryClaimedAction.php index f19107a9d..47be49c87 100644 --- a/app/Actions/Models/List/External/Entry/Claimed/AnilistExternalEntryClaimedAction.php +++ b/app/Actions/Models/List/External/Entry/Claimed/AnilistExternalEntryClaimedAction.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace App\Actions\Models\List\External\Entry\Claimed; use App\Actions\Models\List\External\Entry\BaseExternalEntryClaimedAction; -use App\Enums\Models\List\ExternalEntryWatchStatus; +use App\Enums\Models\List\ExternalEntryStatus; use App\Models\List\External\ExternalEntry; use App\Models\Wiki\ExternalResource; use Illuminate\Http\Client\RequestException; @@ -37,7 +37,7 @@ class AnilistExternalEntryClaimedAction extends BaseExternalEntryClaimedAction $entries[] = [ ExternalResource::ATTRIBUTE_EXTERNAL_ID => $entryId, ExternalEntry::ATTRIBUTE_SCORE => Arr::get($entry, 'score'), - ExternalEntry::ATTRIBUTE_WATCH_STATUS => ExternalEntryWatchStatus::getAnilistMapping(Arr::get($entry, 'status'))->value, + ExternalEntry::ATTRIBUTE_STATUS => ExternalEntryStatus::getAnilistMapping(Arr::get($entry, 'status'))->value, ExternalEntry::ATTRIBUTE_IS_FAVORITE => Arr::get($entry, 'media.isFavourite'), ]; } diff --git a/app/Actions/Models/List/External/Entry/Claimed/MalExternalEntryClaimedAction.php b/app/Actions/Models/List/External/Entry/Claimed/MalExternalEntryClaimedAction.php index 8ac0aa7c3..6eead3db4 100644 --- a/app/Actions/Models/List/External/Entry/Claimed/MalExternalEntryClaimedAction.php +++ b/app/Actions/Models/List/External/Entry/Claimed/MalExternalEntryClaimedAction.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace App\Actions\Models\List\External\Entry\Claimed; use App\Actions\Models\List\External\Entry\BaseExternalEntryClaimedAction; -use App\Enums\Models\List\ExternalEntryWatchStatus; +use App\Enums\Models\List\ExternalEntryStatus; use App\Enums\Models\List\ExternalProfileSite; use App\Models\List\External\ExternalEntry; use App\Models\Wiki\ExternalResource; @@ -42,14 +42,14 @@ class MalExternalEntryClaimedAction extends BaseExternalEntryClaimedAction $animeInfo = Arr::get($info, 'node'); $listStatus = Arr::get($info, 'list_status'); - $watchStatus = Arr::get($listStatus, 'is_rewatching') + $status = Arr::get($listStatus, 'is_rewatching') ? 'rewatching' : Arr::get($listStatus, 'status'); $entries[] = [ ExternalResource::ATTRIBUTE_EXTERNAL_ID => Arr::get($animeInfo, 'id'), ExternalEntry::ATTRIBUTE_SCORE => Arr::get($listStatus, 'score'), - ExternalEntry::ATTRIBUTE_WATCH_STATUS => ExternalEntryWatchStatus::getMalMapping($watchStatus)->value, + ExternalEntry::ATTRIBUTE_STATUS => ExternalEntryStatus::getMalMapping($status)->value, ExternalEntry::ATTRIBUTE_IS_FAVORITE => false, ]; } diff --git a/app/Actions/Models/List/External/Entry/Unclaimed/AnilistExternalEntryUnclaimedAction.php b/app/Actions/Models/List/External/Entry/Unclaimed/AnilistExternalEntryUnclaimedAction.php index 29b662829..a3f920211 100644 --- a/app/Actions/Models/List/External/Entry/Unclaimed/AnilistExternalEntryUnclaimedAction.php +++ b/app/Actions/Models/List/External/Entry/Unclaimed/AnilistExternalEntryUnclaimedAction.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace App\Actions\Models\List\External\Entry\Unclaimed; use App\Actions\Models\List\External\Entry\BaseExternalEntryUnclaimedAction; -use App\Enums\Models\List\ExternalEntryWatchStatus; +use App\Enums\Models\List\ExternalEntryStatus; use App\Models\List\External\ExternalEntry; use App\Models\Wiki\ExternalResource; use Illuminate\Http\Client\RequestException; @@ -37,7 +37,7 @@ class AnilistExternalEntryUnclaimedAction extends BaseExternalEntryUnclaimedActi $entries[] = [ ExternalResource::ATTRIBUTE_EXTERNAL_ID => $entryId, ExternalEntry::ATTRIBUTE_SCORE => Arr::get($entry, 'score'), - ExternalEntry::ATTRIBUTE_WATCH_STATUS => ExternalEntryWatchStatus::getAnilistMapping(Arr::get($entry, 'status'))->value, + ExternalEntry::ATTRIBUTE_STATUS => ExternalEntryStatus::getAnilistMapping(Arr::get($entry, 'status'))->value, ExternalEntry::ATTRIBUTE_IS_FAVORITE => in_array($entryId, $favorites), ]; } diff --git a/app/Actions/Models/List/External/SyncExternalProfileAction.php b/app/Actions/Models/List/External/SyncExternalProfileAction.php index a6f7293a5..91b654135 100644 --- a/app/Actions/Models/List/External/SyncExternalProfileAction.php +++ b/app/Actions/Models/List/External/SyncExternalProfileAction.php @@ -48,7 +48,7 @@ class SyncExternalProfileAction $externalEntries[] = [ ExternalEntry::ATTRIBUTE_SCORE => Arr::get($entry, ExternalEntry::ATTRIBUTE_SCORE), ExternalEntry::ATTRIBUTE_IS_FAVORITE => Arr::get($entry, ExternalEntry::ATTRIBUTE_IS_FAVORITE), - ExternalEntry::ATTRIBUTE_WATCH_STATUS => Arr::get($entry, ExternalEntry::ATTRIBUTE_WATCH_STATUS), + ExternalEntry::ATTRIBUTE_STATUS => Arr::get($entry, ExternalEntry::ATTRIBUTE_STATUS), ExternalEntry::ATTRIBUTE_ANIME => $anime, ExternalEntry::ATTRIBUTE_PROFILE => $profile->getKey(), ]; diff --git a/app/Actions/Storage/Admin/Dump/DumpWikiAction.php b/app/Actions/Storage/Admin/Dump/DumpContentAction.php similarity index 96% rename from app/Actions/Storage/Admin/Dump/DumpWikiAction.php rename to app/Actions/Storage/Admin/Dump/DumpContentAction.php index def003867..ddc79bd8f 100644 --- a/app/Actions/Storage/Admin/Dump/DumpWikiAction.php +++ b/app/Actions/Storage/Admin/Dump/DumpContentAction.php @@ -33,7 +33,7 @@ use Illuminate\Support\Facades\Date; use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; -class DumpWikiAction extends DumpAction +class DumpContentAction extends DumpAction { use ReconcilesDumpRepositories; @@ -82,7 +82,7 @@ class DumpWikiAction extends DumpAction $filesystem = Storage::disk('local'); return Str::of($filesystem->path('')) - ->append(DumpWikiAction::FILENAME_PREFIX) + ->append(DumpContentAction::FILENAME_PREFIX) ->append(strval(Date::now()->valueOf())) ->append('.sql') ->__toString(); diff --git a/app/Console/Commands/Database/DatabaseSyncCommand.php b/app/Console/Commands/Database/DatabaseSyncCommand.php index a3edd61f9..aa4db6f7e 100644 --- a/app/Console/Commands/Database/DatabaseSyncCommand.php +++ b/app/Console/Commands/Database/DatabaseSyncCommand.php @@ -4,12 +4,14 @@ declare(strict_types=1); namespace App\Console\Commands\Database; -use App\Actions\Storage\Admin\Dump\DumpWikiAction; +use App\Actions\Storage\Admin\Dump\DumpContentAction; use App\Console\Commands\BaseCommand; use Database\Seeders\Admin\Feature\FeatureSeeder; use Database\Seeders\Auth\Permission\PermissionSeeder; use Database\Seeders\Auth\Role\RoleSeeder; use Database\Seeders\Scout\ImportModelsSeeder; +use Illuminate\Console\Attributes\Description; +use Illuminate\Console\Attributes\Signature; use Illuminate\Contracts\Validation\Validator; use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\DB; @@ -17,13 +19,13 @@ use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Validator as ValidatorFacade; +#[Signature( + 'db:sync + {--drop : Determine whether the existing database should be re-created}' +)] +#[Description('Sync the local database with the latest dumps')] class DatabaseSyncCommand extends BaseCommand { - protected $signature = 'db:sync - {--drop : Determine whether the existing database should be re-created}'; - - protected $description = 'Sync the local database with the latest dumps'; - public function handle(): int { if (app()->isProduction()) { @@ -45,7 +47,7 @@ class DatabaseSyncCommand extends BaseCommand if (! $this->option('drop')) { Schema::withoutForeignKeyConstraints(function (): void { foreach ([ - ...DumpWikiAction::allowedTables(), + ...DumpContentAction::allowedTables(), ] as $table) { $this->info("Truncating table {$table}"); DB::table($table)->truncate(); @@ -55,9 +57,9 @@ class DatabaseSyncCommand extends BaseCommand DB::statement("USE `{$database}`"); - $this->info('Importing wiki dump'); - $wiki = Http::get('https://dump.animethemes.moe/latest/wiki')->body(); - DB::unprepared($wiki); + $this->info('Importing content dump'); + $content = Http::get('https://dump.animethemes.moe/latest/content')->body(); + DB::unprepared($content); $this->info('Migrating database'); Artisan::call('migrate'); diff --git a/app/Console/Commands/GraphQL/GraphQLPrintSchemaCommand.php b/app/Console/Commands/GraphQL/GraphQLPrintSchemaCommand.php index 798212758..ae69a0433 100644 --- a/app/Console/Commands/GraphQL/GraphQLPrintSchemaCommand.php +++ b/app/Console/Commands/GraphQL/GraphQLPrintSchemaCommand.php @@ -6,16 +6,16 @@ namespace App\Console\Commands\GraphQL; use App\Console\Commands\BaseCommand; use GraphQL\Utils\SchemaPrinter; +use Illuminate\Console\Attributes\Description; +use Illuminate\Console\Attributes\Signature; use Illuminate\Contracts\Validation\Validator; use Illuminate\Support\Facades\Validator as ValidatorFacade; use Rebing\GraphQL\Support\Facades\GraphQL; +#[Signature('graphql:print-schema {schema=v1}')] +#[Description('Print the GraphQL schema into SDL')] class GraphQLPrintSchemaCommand extends BaseCommand { - protected $signature = 'graphql:print-schema {schema=v1}'; - - protected $description = 'Print the GraphQL schema into SDL'; - public function handle(): int { $schemaName = $this->argument('schema'); diff --git a/app/Console/Commands/Models/PlaylistFixCommand.php b/app/Console/Commands/Models/PlaylistFixCommand.php index b3e774526..1ba9fbfde 100644 --- a/app/Console/Commands/Models/PlaylistFixCommand.php +++ b/app/Console/Commands/Models/PlaylistFixCommand.php @@ -7,15 +7,15 @@ namespace App\Console\Commands\Models; use App\Actions\Models\List\Playlist\FixPlaylistAction; use App\Console\Commands\BaseCommand; use App\Models\List\Playlist; +use Illuminate\Console\Attributes\Description; +use Illuminate\Console\Attributes\Signature; use Illuminate\Contracts\Validation\Validator; use Illuminate\Support\Facades\Validator as ValidatorFacade; +#[Signature('playlist:fix {playlistId}')] +#[Description('Fix playlist tracks to remove cycles')] class PlaylistFixCommand extends BaseCommand { - protected $signature = 'playlist:fix {playlistId}'; - - protected $description = 'Fix playlist tracks to remove cycles'; - public function handle(): int { $playlistId = $this->argument('playlistId'); diff --git a/app/Console/Commands/Models/SyncLikeAggregatesCommand.php b/app/Console/Commands/Models/SyncLikeAggregatesCommand.php index b5b5f9e7c..3ae57b9d6 100644 --- a/app/Console/Commands/Models/SyncLikeAggregatesCommand.php +++ b/app/Console/Commands/Models/SyncLikeAggregatesCommand.php @@ -6,15 +6,15 @@ namespace App\Console\Commands\Models; use App\Actions\Models\Aggregate\SyncLikeAggregatesAction; use App\Console\Commands\BaseCommand; +use Illuminate\Console\Attributes\Description; +use Illuminate\Console\Attributes\Signature; use Illuminate\Contracts\Validation\Validator; use Illuminate\Support\Facades\Validator as ValidatorFacade; +#[Signature('like:sync-aggregates')] +#[Description('Synchronizes likes in the aggregates table')] class SyncLikeAggregatesCommand extends BaseCommand { - protected $signature = 'like:sync-aggregates'; - - protected $description = 'Synchronizes likes in the aggregates table'; - public function handle(): int { $action = new SyncLikeAggregatesAction(); diff --git a/app/Console/Commands/Repositories/Storage/Admin/DumpReconcileCommand.php b/app/Console/Commands/Repositories/Storage/Admin/DumpReconcileCommand.php index f8791ff7b..4d7449b26 100644 --- a/app/Console/Commands/Repositories/Storage/Admin/DumpReconcileCommand.php +++ b/app/Console/Commands/Repositories/Storage/Admin/DumpReconcileCommand.php @@ -7,16 +7,16 @@ namespace App\Console\Commands\Repositories\Storage\Admin; use App\Concerns\Repositories\Admin\ReconcilesDumpRepositories; use App\Console\Commands\Repositories\Storage\StorageReconcileCommand; use App\Constants\Config\DumpConstants; +use Illuminate\Console\Attributes\Description; +use Illuminate\Console\Attributes\Signature; use Illuminate\Support\Facades\Config; +#[Signature('reconcile:dump')] +#[Description('Perform set reconciliation between object storage and dump database')] class DumpReconcileCommand extends StorageReconcileCommand { use ReconcilesDumpRepositories; - protected $signature = 'reconcile:dump'; - - protected $description = 'Perform set reconciliation between object storage and dump database'; - public function disk(): string { return Config::get(DumpConstants::DISK_QUALIFIED); diff --git a/app/Console/Commands/Repositories/Storage/Wiki/AudioReconcileCommand.php b/app/Console/Commands/Repositories/Storage/Wiki/AudioReconcileCommand.php index 17581a8da..16bf89de5 100644 --- a/app/Console/Commands/Repositories/Storage/Wiki/AudioReconcileCommand.php +++ b/app/Console/Commands/Repositories/Storage/Wiki/AudioReconcileCommand.php @@ -7,17 +7,19 @@ namespace App\Console\Commands\Repositories\Storage\Wiki; use App\Concerns\Repositories\Wiki\ReconcilesAudioRepositories; use App\Console\Commands\Repositories\Storage\StorageReconcileCommand; use App\Constants\Config\AudioConstants; +use Illuminate\Console\Attributes\Description; +use Illuminate\Console\Attributes\Signature; use Illuminate\Support\Facades\Config; +#[Signature( + 'reconcile:audio + {--path= : The directory of audios to reconcile. Ex: 2022/Spring/. If unspecified, all directories will be listed.}' +)] +#[Description('Perform set reconciliation between object storage and audios database')] class AudioReconcileCommand extends StorageReconcileCommand { use ReconcilesAudioRepositories; - protected $signature = 'reconcile:audio - {--path= : The directory of audios to reconcile. Ex: 2022/Spring/. If unspecified, all directories will be listed.}'; - - protected $description = 'Perform set reconciliation between object storage and audios database'; - public function disk(): string { return Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED); diff --git a/app/Console/Commands/Repositories/Storage/Wiki/Video/ScriptReconcileCommand.php b/app/Console/Commands/Repositories/Storage/Wiki/Video/ScriptReconcileCommand.php index 93f7b811c..dba58034b 100644 --- a/app/Console/Commands/Repositories/Storage/Wiki/Video/ScriptReconcileCommand.php +++ b/app/Console/Commands/Repositories/Storage/Wiki/Video/ScriptReconcileCommand.php @@ -7,17 +7,19 @@ namespace App\Console\Commands\Repositories\Storage\Wiki\Video; use App\Concerns\Repositories\Wiki\Video\ReconcilesScriptRepositories; use App\Console\Commands\Repositories\Storage\StorageReconcileCommand; use App\Constants\Config\VideoConstants; +use Illuminate\Console\Attributes\Description; +use Illuminate\Console\Attributes\Signature; use Illuminate\Support\Facades\Config; +#[Signature( + 'reconcile:script + {--path= : The directory of scripts to reconcile. Ex: 2022/Spring/. If unspecified, all directories will be listed.}' +)] +#[Description('Perform set reconciliation between object storage and script database')] class ScriptReconcileCommand extends StorageReconcileCommand { use ReconcilesScriptRepositories; - protected $signature = 'reconcile:script - {--path= : The directory of scripts to reconcile. Ex: 2022/Spring/. If unspecified, all directories will be listed.}'; - - protected $description = 'Perform set reconciliation between object storage and script database'; - public function disk(): string { return Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED); diff --git a/app/Console/Commands/Repositories/Storage/Wiki/VideoReconcileCommand.php b/app/Console/Commands/Repositories/Storage/Wiki/VideoReconcileCommand.php index 55bf1eed2..3416a6719 100644 --- a/app/Console/Commands/Repositories/Storage/Wiki/VideoReconcileCommand.php +++ b/app/Console/Commands/Repositories/Storage/Wiki/VideoReconcileCommand.php @@ -7,17 +7,19 @@ namespace App\Console\Commands\Repositories\Storage\Wiki; use App\Concerns\Repositories\Wiki\ReconcilesVideoRepositories; use App\Console\Commands\Repositories\Storage\StorageReconcileCommand; use App\Constants\Config\VideoConstants; +use Illuminate\Console\Attributes\Description; +use Illuminate\Console\Attributes\Signature; use Illuminate\Support\Facades\Config; +#[Signature( + 'reconcile:video + {--path= : The directory of videos to reconcile. Ex: 2022/Spring/. If unspecified, all directories will be listed.}' +)] +#[Description('Perform set reconciliation between object storage and video database')] class VideoReconcileCommand extends StorageReconcileCommand { use ReconcilesVideoRepositories; - protected $signature = 'reconcile:video - {--path= : The directory of videos to reconcile. Ex: 2022/Spring/. If unspecified, all directories will be listed.}'; - - protected $description = 'Perform set reconciliation between object storage and video database'; - public function disk(): string { return Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED); diff --git a/app/Console/Commands/Storage/Admin/AdminDumpCommand.php b/app/Console/Commands/Storage/Admin/AdminDumpCommand.php index 80b3346ef..6053ec733 100644 --- a/app/Console/Commands/Storage/Admin/AdminDumpCommand.php +++ b/app/Console/Commands/Storage/Admin/AdminDumpCommand.php @@ -5,29 +5,30 @@ declare(strict_types=1); namespace App\Console\Commands\Storage\Admin; use App\Actions\Storage\Admin\Dump\DumpAdminAction; +use Illuminate\Console\Attributes\Description; +use Illuminate\Console\Attributes\Signature; +#[Signature( + 'db:dump-admin + {--comments : Write additional information in the MySQL dump such as program version, server version and host} + {--data-only : Dump only the data without the schema in PostgreSQL dump} + {--default-character-set=utf8 : Specify default character set in MySQL dump} + {--extended-insert : Use multiple-row insert syntax in MySQL dump} + {--inserts : Dump data as INSERT commands rather than COPY in PostgreSQL dump} + {--lock-tables : Lock all tables before dumping them to MySQL dump} + {--no-create-info : Turn off CREATE TABLE statements in MySQL dump} + {--quick : Retrieve rows for a table from the server one row at a time in MySQL dump} + {--set-gtid-purged=AUTO : Add SET GTID_PURGED to output in MySQL dump} + {--single-transaction=true : Issue a BEGIN SQL statement before dumping data from server for MySQL dump} + {--skip-column-statistics : Turn off ANALYZE table statements in the MySQL dump} + {--skip-comments : Do not write additional information in the MySQL dump} + {--skip-extended-insert : Turn off extended-insert in MySQL dump} + {--skip-lock-tables : Turn off locking tables before dumping to MySQL dump} + {--skip-quick : Do not retrieve rows for a table from the server one row at a time in MySQL dump}' +)] +#[Description('Produces sanitized database dump, targeting admin-related tables for seeding purposes')] class AdminDumpCommand extends DumpCommand { - protected $signature = 'db:dump-admin - {--comments : Write additional information in the MySQL dump such as program version, server version and host} - {--data-only : Dump only the data without the schema in PostgreSQL dump} - {--default-character-set=utf8 : Specify default character set in MySQL dump} - {--extended-insert : Use multiple-row insert syntax in MySQL dump} - {--inserts : Dump data as INSERT commands rather than COPY in PostgreSQL dump} - {--lock-tables : Lock all tables before dumping them to MySQL dump} - {--no-create-info : Turn off CREATE TABLE statements in MySQL dump} - {--quick : Retrieve rows for a table from the server one row at a time in MySQL dump} - {--set-gtid-purged=AUTO : Add SET GTID_PURGED to output in MySQL dump} - {--single-transaction=true : Issue a BEGIN SQL statement before dumping data from server for MySQL dump} - {--skip-column-statistics : Turn off ANALYZE table statements in the MySQL dump} - {--skip-comments : Do not write additional information in the MySQL dump} - {--skip-extended-insert : Turn off extended-insert in MySQL dump} - {--skip-lock-tables : Turn off locking tables before dumping to MySQL dump} - {--skip-quick : Do not retrieve rows for a table from the server one row at a time in MySQL dump} - '; - - protected $description = 'Produces sanitized database dump, targeting admin-related tables for seeding purposes'; - protected function action(): DumpAdminAction { return new DumpAdminAction($this->options()); diff --git a/app/Console/Commands/Storage/Admin/AuthDumpCommand.php b/app/Console/Commands/Storage/Admin/AuthDumpCommand.php index 4728e50d8..d8d4c796b 100644 --- a/app/Console/Commands/Storage/Admin/AuthDumpCommand.php +++ b/app/Console/Commands/Storage/Admin/AuthDumpCommand.php @@ -5,29 +5,30 @@ declare(strict_types=1); namespace App\Console\Commands\Storage\Admin; use App\Actions\Storage\Admin\Dump\DumpAuthAction; +use Illuminate\Console\Attributes\Description; +use Illuminate\Console\Attributes\Signature; +#[Signature( + 'db:dump-auth + {--comments : Write additional information in the MySQL dump such as program version, server version and host} + {--data-only : Dump only the data without the schema in PostgreSQL dump} + {--default-character-set=utf8 : Specify default character set in MySQL dump} + {--extended-insert : Use multiple-row insert syntax in MySQL dump} + {--inserts : Dump data as INSERT commands rather than COPY in PostgreSQL dump} + {--lock-tables : Lock all tables before dumping them to MySQL dump} + {--no-create-info : Turn off CREATE TABLE statements in MySQL dump} + {--quick : Retrieve rows for a table from the server one row at a time in MySQL dump} + {--set-gtid-purged=AUTO : Add SET GTID_PURGED to output in MySQL dump} + {--single-transaction=true : Issue a BEGIN SQL statement before dumping data from server for MySQL dump} + {--skip-column-statistics : Turn off ANALYZE table statements in the MySQL dump} + {--skip-comments : Do not write additional information in the MySQL dump} + {--skip-extended-insert : Turn off extended-insert in MySQL dump} + {--skip-lock-tables : Turn off locking tables before dumping to MySQL dump} + {--skip-quick : Do not retrieve rows for a table from the server one row at a time in MySQL dump}' +)] +#[Description('Produces sanitized database dump, targeting auth-related tables for seeding purposes')] class AuthDumpCommand extends DumpCommand { - protected $signature = 'db:dump-auth - {--comments : Write additional information in the MySQL dump such as program version, server version and host} - {--data-only : Dump only the data without the schema in PostgreSQL dump} - {--default-character-set=utf8 : Specify default character set in MySQL dump} - {--extended-insert : Use multiple-row insert syntax in MySQL dump} - {--inserts : Dump data as INSERT commands rather than COPY in PostgreSQL dump} - {--lock-tables : Lock all tables before dumping them to MySQL dump} - {--no-create-info : Turn off CREATE TABLE statements in MySQL dump} - {--quick : Retrieve rows for a table from the server one row at a time in MySQL dump} - {--set-gtid-purged=AUTO : Add SET GTID_PURGED to output in MySQL dump} - {--single-transaction=true : Issue a BEGIN SQL statement before dumping data from server for MySQL dump} - {--skip-column-statistics : Turn off ANALYZE table statements in the MySQL dump} - {--skip-comments : Do not write additional information in the MySQL dump} - {--skip-extended-insert : Turn off extended-insert in MySQL dump} - {--skip-lock-tables : Turn off locking tables before dumping to MySQL dump} - {--skip-quick : Do not retrieve rows for a table from the server one row at a time in MySQL dump} - '; - - protected $description = 'Produces sanitized database dump, targeting auth-related tables for seeding purposes'; - protected function action(): DumpAuthAction { return new DumpAuthAction($this->options()); diff --git a/app/Console/Commands/Storage/Admin/ContentDumpCommand.php b/app/Console/Commands/Storage/Admin/ContentDumpCommand.php new file mode 100644 index 000000000..103db32a9 --- /dev/null +++ b/app/Console/Commands/Storage/Admin/ContentDumpCommand.php @@ -0,0 +1,36 @@ +options()); + } +} diff --git a/app/Console/Commands/Storage/Admin/DiscordDumpCommand.php b/app/Console/Commands/Storage/Admin/DiscordDumpCommand.php index 63ab34127..296f1a097 100644 --- a/app/Console/Commands/Storage/Admin/DiscordDumpCommand.php +++ b/app/Console/Commands/Storage/Admin/DiscordDumpCommand.php @@ -5,29 +5,30 @@ declare(strict_types=1); namespace App\Console\Commands\Storage\Admin; use App\Actions\Storage\Admin\Dump\DumpDiscordAction; +use Illuminate\Console\Attributes\Description; +use Illuminate\Console\Attributes\Signature; +#[Signature( + 'db:dump-discord + {--comments : Write additional information in the MySQL dump such as program version, server version and host} + {--data-only : Dump only the data without the schema in PostgreSQL dump} + {--default-character-set=utf8 : Specify default character set in MySQL dump} + {--extended-insert : Use multiple-row insert syntax in MySQL dump} + {--inserts : Dump data as INSERT commands rather than COPY in PostgreSQL dump} + {--lock-tables : Lock all tables before dumping them to MySQL dump} + {--no-create-info : Turn off CREATE TABLE statements in MySQL dump} + {--quick : Retrieve rows for a table from the server one row at a time in MySQL dump} + {--set-gtid-purged=AUTO : Add SET GTID_PURGED to output in MySQL dump} + {--single-transaction=true : Issue a BEGIN SQL statement before dumping data from server for MySQL dump} + {--skip-column-statistics : Turn off ANALYZE table statements in the MySQL dump} + {--skip-comments : Do not write additional information in the MySQL dump} + {--skip-extended-insert : Turn off extended-insert in MySQL dump} + {--skip-lock-tables : Turn off locking tables before dumping to MySQL dump} + {--skip-quick : Do not retrieve rows for a table from the server one row at a time in MySQL dump}' +)] +#[Description('Produces sanitized database dump, targeting discord-related tables for seeding purposes')] class DiscordDumpCommand extends DumpCommand { - protected $signature = 'db:dump-discord - {--comments : Write additional information in the MySQL dump such as program version, server version and host} - {--data-only : Dump only the data without the schema in PostgreSQL dump} - {--default-character-set=utf8 : Specify default character set in MySQL dump} - {--extended-insert : Use multiple-row insert syntax in MySQL dump} - {--inserts : Dump data as INSERT commands rather than COPY in PostgreSQL dump} - {--lock-tables : Lock all tables before dumping them to MySQL dump} - {--no-create-info : Turn off CREATE TABLE statements in MySQL dump} - {--quick : Retrieve rows for a table from the server one row at a time in MySQL dump} - {--set-gtid-purged=AUTO : Add SET GTID_PURGED to output in MySQL dump} - {--single-transaction=true : Issue a BEGIN SQL statement before dumping data from server for MySQL dump} - {--skip-column-statistics : Turn off ANALYZE table statements in the MySQL dump} - {--skip-comments : Do not write additional information in the MySQL dump} - {--skip-extended-insert : Turn off extended-insert in MySQL dump} - {--skip-lock-tables : Turn off locking tables before dumping to MySQL dump} - {--skip-quick : Do not retrieve rows for a table from the server one row at a time in MySQL dump} - '; - - protected $description = 'Produces sanitized database dump, targeting discord-related tables for seeding purposes'; - protected function action(): DumpDiscordAction { return new DumpDiscordAction($this->options()); diff --git a/app/Console/Commands/Storage/Admin/DocumentDumpCommand.php b/app/Console/Commands/Storage/Admin/DocumentDumpCommand.php index 0566db44b..e8dfd6a01 100644 --- a/app/Console/Commands/Storage/Admin/DocumentDumpCommand.php +++ b/app/Console/Commands/Storage/Admin/DocumentDumpCommand.php @@ -5,29 +5,30 @@ declare(strict_types=1); namespace App\Console\Commands\Storage\Admin; use App\Actions\Storage\Admin\Dump\DumpDocumentAction; +use Illuminate\Console\Attributes\Description; +use Illuminate\Console\Attributes\Signature; +#[Signature( + 'db:dump-document + {--comments : Write additional information in the MySQL dump such as program version, server version and host} + {--data-only : Dump only the data without the schema in PostgreSQL dump} + {--default-character-set=utf8 : Specify default character set in MySQL dump} + {--extended-insert : Use multiple-row insert syntax in MySQL dump} + {--inserts : Dump data as INSERT commands rather than COPY in PostgreSQL dump} + {--lock-tables : Lock all tables before dumping them to MySQL dump} + {--no-create-info : Turn off CREATE TABLE statements in MySQL dump} + {--quick : Retrieve rows for a table from the server one row at a time in MySQL dump} + {--set-gtid-purged=AUTO : Add SET GTID_PURGED to output in MySQL dump} + {--single-transaction=true : Issue a BEGIN SQL statement before dumping data from server for MySQL dump} + {--skip-column-statistics : Turn off ANALYZE table statements in the MySQL dump} + {--skip-comments : Do not write additional information in the MySQL dump} + {--skip-extended-insert : Turn off extended-insert in MySQL dump} + {--skip-lock-tables : Turn off locking tables before dumping to MySQL dump} + {--skip-quick : Do not retrieve rows for a table from the server one row at a time in MySQL dump}' +)] +#[Description('Produces sanitized database dump, targeting document-related tables for seeding purposes')] class DocumentDumpCommand extends DumpCommand { - protected $signature = 'db:dump-document - {--comments : Write additional information in the MySQL dump such as program version, server version and host} - {--data-only : Dump only the data without the schema in PostgreSQL dump} - {--default-character-set=utf8 : Specify default character set in MySQL dump} - {--extended-insert : Use multiple-row insert syntax in MySQL dump} - {--inserts : Dump data as INSERT commands rather than COPY in PostgreSQL dump} - {--lock-tables : Lock all tables before dumping them to MySQL dump} - {--no-create-info : Turn off CREATE TABLE statements in MySQL dump} - {--quick : Retrieve rows for a table from the server one row at a time in MySQL dump} - {--set-gtid-purged=AUTO : Add SET GTID_PURGED to output in MySQL dump} - {--single-transaction=true : Issue a BEGIN SQL statement before dumping data from server for MySQL dump} - {--skip-column-statistics : Turn off ANALYZE table statements in the MySQL dump} - {--skip-comments : Do not write additional information in the MySQL dump} - {--skip-extended-insert : Turn off extended-insert in MySQL dump} - {--skip-lock-tables : Turn off locking tables before dumping to MySQL dump} - {--skip-quick : Do not retrieve rows for a table from the server one row at a time in MySQL dump} - '; - - protected $description = 'Produces sanitized database dump, targeting document-related tables for seeding purposes'; - protected function action(): DumpDocumentAction { return new DumpDocumentAction($this->options()); diff --git a/app/Console/Commands/Storage/Admin/DumpPruneCommand.php b/app/Console/Commands/Storage/Admin/DumpPruneCommand.php index 801133603..82c5d42cc 100644 --- a/app/Console/Commands/Storage/Admin/DumpPruneCommand.php +++ b/app/Console/Commands/Storage/Admin/DumpPruneCommand.php @@ -7,11 +7,11 @@ namespace App\Console\Commands\Storage\Admin; use App\Actions\Storage\Admin\Dump\PruneDumpAction; use App\Actions\Storage\Base\PruneAction; use App\Console\Commands\Storage\Base\PruneCommand; +use Illuminate\Console\Attributes\Signature; +#[Signature('prune:dump {--H|hours=72 : The number of hours to retain dumps}')] class DumpPruneCommand extends PruneCommand { - protected $signature = 'prune:dump {--H|hours=72 : The number of hours to retain dumps}'; - protected function getAction(): PruneAction { $hours = $this->option('hours'); diff --git a/app/Console/Commands/Storage/Admin/ListDumpCommand.php b/app/Console/Commands/Storage/Admin/ListDumpCommand.php index 71ccf95c0..26f786bca 100644 --- a/app/Console/Commands/Storage/Admin/ListDumpCommand.php +++ b/app/Console/Commands/Storage/Admin/ListDumpCommand.php @@ -5,29 +5,30 @@ declare(strict_types=1); namespace App\Console\Commands\Storage\Admin; use App\Actions\Storage\Admin\Dump\DumpListAction; +use Illuminate\Console\Attributes\Description; +use Illuminate\Console\Attributes\Signature; +#[Signature( + 'db:dump-list + {--comments : Write additional information in the MySQL dump such as program version, server version and host} + {--data-only : Dump only the data without the schema in PostgreSQL dump} + {--default-character-set=utf8 : Specify default character set in MySQL dump} + {--extended-insert : Use multiple-row insert syntax in MySQL dump} + {--inserts : Dump data as INSERT commands rather than COPY in PostgreSQL dump} + {--lock-tables : Lock all tables before dumping them to MySQL dump} + {--no-create-info : Turn off CREATE TABLE statements in MySQL dump} + {--quick : Retrieve rows for a table from the server one row at a time in MySQL dump} + {--set-gtid-purged=AUTO : Add SET GTID_PURGED to output in MySQL dump} + {--single-transaction=true : Issue a BEGIN SQL statement before dumping data from server for MySQL dump} + {--skip-column-statistics : Turn off ANALYZE table statements in the MySQL dump} + {--skip-comments : Do not write additional information in the MySQL dump} + {--skip-extended-insert : Turn off extended-insert in MySQL dump} + {--skip-lock-tables : Turn off locking tables before dumping to MySQL dump} + {--skip-quick : Do not retrieve rows for a table from the server one row at a time in MySQL dump}' +)] +#[Description('Produces sanitized database dump, targeting list-related tables for seeding purposes')] class ListDumpCommand extends DumpCommand { - protected $signature = 'db:dump-list - {--comments : Write additional information in the MySQL dump such as program version, server version and host} - {--data-only : Dump only the data without the schema in PostgreSQL dump} - {--default-character-set=utf8 : Specify default character set in MySQL dump} - {--extended-insert : Use multiple-row insert syntax in MySQL dump} - {--inserts : Dump data as INSERT commands rather than COPY in PostgreSQL dump} - {--lock-tables : Lock all tables before dumping them to MySQL dump} - {--no-create-info : Turn off CREATE TABLE statements in MySQL dump} - {--quick : Retrieve rows for a table from the server one row at a time in MySQL dump} - {--set-gtid-purged=AUTO : Add SET GTID_PURGED to output in MySQL dump} - {--single-transaction=true : Issue a BEGIN SQL statement before dumping data from server for MySQL dump} - {--skip-column-statistics : Turn off ANALYZE table statements in the MySQL dump} - {--skip-comments : Do not write additional information in the MySQL dump} - {--skip-extended-insert : Turn off extended-insert in MySQL dump} - {--skip-lock-tables : Turn off locking tables before dumping to MySQL dump} - {--skip-quick : Do not retrieve rows for a table from the server one row at a time in MySQL dump} - '; - - protected $description = 'Produces sanitized database dump, targeting list-related tables for seeding purposes'; - protected function action(): DumpListAction { return new DumpListAction($this->options()); diff --git a/app/Console/Commands/Storage/Admin/UserDumpCommand.php b/app/Console/Commands/Storage/Admin/UserDumpCommand.php index ad822108d..9dbdaa8e1 100644 --- a/app/Console/Commands/Storage/Admin/UserDumpCommand.php +++ b/app/Console/Commands/Storage/Admin/UserDumpCommand.php @@ -5,29 +5,30 @@ declare(strict_types=1); namespace App\Console\Commands\Storage\Admin; use App\Actions\Storage\Admin\Dump\DumpUserAction; +use Illuminate\Console\Attributes\Description; +use Illuminate\Console\Attributes\Signature; +#[Signature( + 'db:dump-user + {--comments : Write additional information in the MySQL dump such as program version, server version and host} + {--data-only : Dump only the data without the schema in PostgreSQL dump} + {--default-character-set=utf8 : Specify default character set in MySQL dump} + {--extended-insert : Use multiple-row insert syntax in MySQL dump} + {--inserts : Dump data as INSERT commands rather than COPY in PostgreSQL dump} + {--lock-tables : Lock all tables before dumping them to MySQL dump} + {--no-create-info : Turn off CREATE TABLE statements in MySQL dump} + {--quick : Retrieve rows for a table from the server one row at a time in MySQL dump} + {--set-gtid-purged=AUTO : Add SET GTID_PURGED to output in MySQL dump} + {--single-transaction=true : Issue a BEGIN SQL statement before dumping data from server for MySQL dump} + {--skip-column-statistics : Turn off ANALYZE table statements in the MySQL dump} + {--skip-comments : Do not write additional information in the MySQL dump} + {--skip-extended-insert : Turn off extended-insert in MySQL dump} + {--skip-lock-tables : Turn off locking tables before dumping to MySQL dump} + {--skip-quick : Do not retrieve rows for a table from the server one row at a time in MySQL dump}' +)] +#[Description('Produces sanitized database dump, targeting user-related tables for seeding purposes')] class UserDumpCommand extends DumpCommand { - protected $signature = 'db:dump-user - {--comments : Write additional information in the MySQL dump such as program version, server version and host} - {--data-only : Dump only the data without the schema in PostgreSQL dump} - {--default-character-set=utf8 : Specify default character set in MySQL dump} - {--extended-insert : Use multiple-row insert syntax in MySQL dump} - {--inserts : Dump data as INSERT commands rather than COPY in PostgreSQL dump} - {--lock-tables : Lock all tables before dumping them to MySQL dump} - {--no-create-info : Turn off CREATE TABLE statements in MySQL dump} - {--quick : Retrieve rows for a table from the server one row at a time in MySQL dump} - {--set-gtid-purged=AUTO : Add SET GTID_PURGED to output in MySQL dump} - {--single-transaction=true : Issue a BEGIN SQL statement before dumping data from server for MySQL dump} - {--skip-column-statistics : Turn off ANALYZE table statements in the MySQL dump} - {--skip-comments : Do not write additional information in the MySQL dump} - {--skip-extended-insert : Turn off extended-insert in MySQL dump} - {--skip-lock-tables : Turn off locking tables before dumping to MySQL dump} - {--skip-quick : Do not retrieve rows for a table from the server one row at a time in MySQL dump} - '; - - protected $description = 'Produces sanitized database dump, targeting user-related tables for seeding purposes'; - protected function action(): DumpUserAction { return new DumpUserAction($this->options()); diff --git a/app/Console/Commands/Storage/Admin/WikiDumpCommand.php b/app/Console/Commands/Storage/Admin/WikiDumpCommand.php deleted file mode 100644 index 84f24b45b..000000000 --- a/app/Console/Commands/Storage/Admin/WikiDumpCommand.php +++ /dev/null @@ -1,35 +0,0 @@ -options()); - } -} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index a8daac907..37a19c6a6 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -8,12 +8,12 @@ use App\Console\Commands\Models\SyncLikeAggregatesCommand; use App\Console\Commands\Repositories\Storage\Admin\DumpReconcileCommand; use App\Console\Commands\Storage\Admin\AdminDumpCommand; use App\Console\Commands\Storage\Admin\AuthDumpCommand; +use App\Console\Commands\Storage\Admin\ContentDumpCommand; use App\Console\Commands\Storage\Admin\DiscordDumpCommand; use App\Console\Commands\Storage\Admin\DocumentDumpCommand; use App\Console\Commands\Storage\Admin\DumpPruneCommand; use App\Console\Commands\Storage\Admin\ListDumpCommand; use App\Console\Commands\Storage\Admin\UserDumpCommand; -use App\Console\Commands\Storage\Admin\WikiDumpCommand; use App\Models\BaseModel; use Illuminate\Auth\Console\ClearResetsCommand; use Illuminate\Cache\Console\PruneStaleTagsCommand; @@ -43,7 +43,7 @@ class Kernel extends ConsoleKernel ->storeOutput() ->everyFifteenMinutes(); - $schedule->command(WikiDumpCommand::class) + $schedule->command(ContentDumpCommand::class) ->withoutOverlapping() ->runInBackground() ->storeOutput() diff --git a/app/Enums/Models/List/ExternalEntryWatchStatus.php b/app/Enums/Models/List/ExternalEntryStatus.php similarity index 88% rename from app/Enums/Models/List/ExternalEntryWatchStatus.php rename to app/Enums/Models/List/ExternalEntryStatus.php index fcfac3c03..5138840ca 100644 --- a/app/Enums/Models/List/ExternalEntryWatchStatus.php +++ b/app/Enums/Models/List/ExternalEntryStatus.php @@ -7,7 +7,7 @@ namespace App\Enums\Models\List; use App\Concerns\Enums\LocalizesName; use Filament\Support\Contracts\HasLabel; -enum ExternalEntryWatchStatus: int implements HasLabel +enum ExternalEntryStatus: int implements HasLabel { use LocalizesName; @@ -19,7 +19,7 @@ enum ExternalEntryWatchStatus: int implements HasLabel case REWATCHING = 5; /** - * Get the watch status by the MAL key. + * Get the status by the MAL key. */ public static function getMalMapping(string $status): static { @@ -34,7 +34,7 @@ enum ExternalEntryWatchStatus: int implements HasLabel } /** - * Get the watch status by the AniList key. + * Get the status by the AniList key. */ public static function getAnilistMapping(string $status): static { diff --git a/app/Filament/Actions/Storage/Admin/DumpWikiAction.php b/app/Filament/Actions/Storage/Admin/DumpContentAction.php similarity index 61% rename from app/Filament/Actions/Storage/Admin/DumpWikiAction.php rename to app/Filament/Actions/Storage/Admin/DumpContentAction.php index 70a8cc2cd..3ff10f424 100644 --- a/app/Filament/Actions/Storage/Admin/DumpWikiAction.php +++ b/app/Filament/Actions/Storage/Admin/DumpContentAction.php @@ -5,20 +5,20 @@ declare(strict_types=1); namespace App\Filament\Actions\Storage\Admin; use App\Actions\Storage\Admin\Dump\DumpAction as DumpDatabase; -use App\Actions\Storage\Admin\Dump\DumpWikiAction as DumpWikiDatabase; +use App\Actions\Storage\Admin\Dump\DumpContentAction as DumpContentDatabase; -class DumpWikiAction extends DumpAction +class DumpContentAction extends DumpAction { public static function getDefaultName(): ?string { - return 'dump-wiki'; + return 'dump-content'; } protected function setUp(): void { parent::setUp(); - $this->label(__('filament.actions.dump.dump.name.wiki')); + $this->label(__('filament.actions.dump.dump.name.content')); } /** @@ -26,6 +26,6 @@ class DumpWikiAction extends DumpAction */ protected function storageAction(array $data): DumpDatabase { - return new DumpWikiDatabase($data); + return new DumpContentDatabase($data); } } diff --git a/app/Filament/Resources/Admin/DumpResource.php b/app/Filament/Resources/Admin/DumpResource.php index d3d111c87..55fed1186 100644 --- a/app/Filament/Resources/Admin/DumpResource.php +++ b/app/Filament/Resources/Admin/DumpResource.php @@ -7,8 +7,8 @@ namespace App\Filament\Resources\Admin; use App\Enums\Filament\NavigationGroup; use App\Filament\Actions\Repositories\Storage\Admin\Dump\ReconcileDumpAction; use App\Filament\Actions\Storage\Admin\DownloadDumpAction; +use App\Filament\Actions\Storage\Admin\DumpContentAction; use App\Filament\Actions\Storage\Admin\DumpDocumentAction; -use App\Filament\Actions\Storage\Admin\DumpWikiAction; use App\Filament\Actions\Storage\Admin\PruneDumpAction; use App\Filament\Components\Columns\TextColumn; use App\Filament\Components\Fields\TextInput; @@ -137,7 +137,7 @@ class DumpResource extends BaseResource { return [ ActionGroup::make([ - DumpWikiAction::make(), + DumpContentAction::make(), DumpDocumentAction::make(), diff --git a/app/Filament/Resources/List/External/ExternalEntryResource.php b/app/Filament/Resources/List/External/ExternalEntryResource.php index baeeb77b7..5cd7d8922 100644 --- a/app/Filament/Resources/List/External/ExternalEntryResource.php +++ b/app/Filament/Resources/List/External/ExternalEntryResource.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace App\Filament\Resources\List\External; use App\Enums\Filament\NavigationGroup; -use App\Enums\Models\List\ExternalEntryWatchStatus; +use App\Enums\Models\List\ExternalEntryStatus; use App\Filament\Components\Columns\BelongsToColumn; use App\Filament\Components\Columns\TextColumn; use App\Filament\Components\Fields\BelongsTo; @@ -99,10 +99,10 @@ class ExternalEntryResource extends BaseResource ->helperText(__('filament.fields.external_entry.score.help')) ->numeric(), - Select::make(ExternalEntry::ATTRIBUTE_WATCH_STATUS) - ->label(__('filament.fields.external_entry.watch_status.name')) - ->helperText(__('filament.fields.external_entry.watch_status.help')) - ->options(ExternalEntryWatchStatus::class) + Select::make(ExternalEntry::ATTRIBUTE_STATUS) + ->label(__('filament.fields.external_entry.status.name')) + ->helperText(__('filament.fields.external_entry.status.help')) + ->options(ExternalEntryStatus::class) ->required(), Checkbox::make(ExternalEntry::ATTRIBUTE_IS_FAVORITE) @@ -127,9 +127,9 @@ class ExternalEntryResource extends BaseResource TextColumn::make(ExternalEntry::ATTRIBUTE_SCORE) ->label(__('filament.fields.external_entry.score.name')), - TextColumn::make(ExternalEntry::ATTRIBUTE_WATCH_STATUS) - ->label(__('filament.fields.external_entry.watch_status.name')) - ->formatStateUsing(fn (ExternalEntryWatchStatus $state): ?string => $state->localize()), + TextColumn::make(ExternalEntry::ATTRIBUTE_STATUS) + ->label(__('filament.fields.external_entry.status.name')) + ->formatStateUsing(fn (ExternalEntryStatus $state): ?string => $state->localize()), TextColumn::make(ExternalEntry::ATTRIBUTE_ID) ->label(__('filament.fields.base.id')), @@ -152,9 +152,9 @@ class ExternalEntryResource extends BaseResource TextEntry::make(ExternalEntry::ATTRIBUTE_SCORE) ->label(__('filament.fields.external_entry.score.name')), - TextEntry::make(ExternalEntry::ATTRIBUTE_WATCH_STATUS) - ->label(__('filament.fields.external_entry.watch_status.name')) - ->formatStateUsing(fn (ExternalEntryWatchStatus $state): ?string => $state->localize()), + TextEntry::make(ExternalEntry::ATTRIBUTE_STATUS) + ->label(__('filament.fields.external_entry.status.name')) + ->formatStateUsing(fn (ExternalEntryStatus $state): ?string => $state->localize()), TextEntry::make(ExternalEntry::ATTRIBUTE_ID) ->label(__('filament.fields.base.id')), @@ -179,8 +179,8 @@ class ExternalEntryResource extends BaseResource NumberConstraint::make(ExternalEntry::ATTRIBUTE_SCORE) ->label(__('filament.fields.external_entry.score.name')), - SelectConstraint::make(ExternalEntry::ATTRIBUTE_WATCH_STATUS) - ->label(__('filament.fields.external_entry.watch_status.name')) + SelectConstraint::make(ExternalEntry::ATTRIBUTE_STATUS) + ->label(__('filament.fields.external_entry.status.name')) ->multiple(), ...parent::getConstraints(), diff --git a/app/Filament/Widgets/Auth/UserChart.php b/app/Filament/Widgets/Auth/UserChart.php index 4adb72f96..9fcf41215 100644 --- a/app/Filament/Widgets/Auth/UserChart.php +++ b/app/Filament/Widgets/Auth/UserChart.php @@ -6,7 +6,7 @@ namespace App\Filament\Widgets\Auth; use App\Filament\Widgets\BaseChartWidget; use App\Models\Auth\User; -use Flowframe\Trend\TrendValue; +use App\Services\FlowframeTrend\TrendValue; class UserChart extends BaseChartWidget { diff --git a/app/Filament/Widgets/BaseChartWidget.php b/app/Filament/Widgets/BaseChartWidget.php index 73a3f6020..4d777ecce 100644 --- a/app/Filament/Widgets/BaseChartWidget.php +++ b/app/Filament/Widgets/BaseChartWidget.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace App\Filament\Widgets; +use App\Services\FlowframeTrend\Trend; use Elemind\FilamentECharts\Widgets\EChartWidget; -use Flowframe\Trend\Trend; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Cache; diff --git a/app/Filament/Widgets/List/ExternalProfileChart.php b/app/Filament/Widgets/List/ExternalProfileChart.php index f20d1958b..93d232a71 100644 --- a/app/Filament/Widgets/List/ExternalProfileChart.php +++ b/app/Filament/Widgets/List/ExternalProfileChart.php @@ -6,7 +6,7 @@ namespace App\Filament\Widgets\List; use App\Filament\Widgets\BaseChartWidget; use App\Models\List\ExternalProfile; -use Flowframe\Trend\TrendValue; +use App\Services\FlowframeTrend\TrendValue; class ExternalProfileChart extends BaseChartWidget { diff --git a/app/Filament/Widgets/List/PlaylistChart.php b/app/Filament/Widgets/List/PlaylistChart.php index 28865d05a..6cd397302 100644 --- a/app/Filament/Widgets/List/PlaylistChart.php +++ b/app/Filament/Widgets/List/PlaylistChart.php @@ -6,7 +6,7 @@ namespace App\Filament\Widgets\List; use App\Filament\Widgets\BaseChartWidget; use App\Models\List\Playlist; -use Flowframe\Trend\TrendValue; +use App\Services\FlowframeTrend\TrendValue; class PlaylistChart extends BaseChartWidget { diff --git a/app/Filament/Widgets/List/PlaylistTrackChart.php b/app/Filament/Widgets/List/PlaylistTrackChart.php index dd0191c7c..633b8ad5b 100644 --- a/app/Filament/Widgets/List/PlaylistTrackChart.php +++ b/app/Filament/Widgets/List/PlaylistTrackChart.php @@ -6,7 +6,7 @@ namespace App\Filament\Widgets\List; use App\Filament\Widgets\BaseChartWidget; use App\Models\List\Playlist\PlaylistTrack; -use Flowframe\Trend\TrendValue; +use App\Services\FlowframeTrend\TrendValue; class PlaylistTrackChart extends BaseChartWidget { diff --git a/app/Filament/Widgets/Wiki/Anime/AnimeChart.php b/app/Filament/Widgets/Wiki/Anime/AnimeChart.php index 88be74a68..45ba14dfa 100644 --- a/app/Filament/Widgets/Wiki/Anime/AnimeChart.php +++ b/app/Filament/Widgets/Wiki/Anime/AnimeChart.php @@ -6,7 +6,7 @@ namespace App\Filament\Widgets\Wiki\Anime; use App\Filament\Widgets\BaseChartWidget; use App\Models\Wiki\Anime; -use Flowframe\Trend\TrendValue; +use App\Services\FlowframeTrend\TrendValue; class AnimeChart extends BaseChartWidget { diff --git a/app/Filament/Widgets/Wiki/Artist/ArtistChart.php b/app/Filament/Widgets/Wiki/Artist/ArtistChart.php index 50a09b262..6d0d03a96 100644 --- a/app/Filament/Widgets/Wiki/Artist/ArtistChart.php +++ b/app/Filament/Widgets/Wiki/Artist/ArtistChart.php @@ -6,7 +6,7 @@ namespace App\Filament\Widgets\Wiki\Artist; use App\Filament\Widgets\BaseChartWidget; use App\Models\Wiki\Artist; -use Flowframe\Trend\TrendValue; +use App\Services\FlowframeTrend\TrendValue; class ArtistChart extends BaseChartWidget { diff --git a/app/Filament/Widgets/Wiki/Series/SeriesChart.php b/app/Filament/Widgets/Wiki/Series/SeriesChart.php index b88d557e1..dd045e2b4 100644 --- a/app/Filament/Widgets/Wiki/Series/SeriesChart.php +++ b/app/Filament/Widgets/Wiki/Series/SeriesChart.php @@ -6,7 +6,7 @@ namespace App\Filament\Widgets\Wiki\Series; use App\Filament\Widgets\BaseChartWidget; use App\Models\Wiki\Series; -use Flowframe\Trend\TrendValue; +use App\Services\FlowframeTrend\TrendValue; class SeriesChart extends BaseChartWidget { diff --git a/app/Filament/Widgets/Wiki/Video/VideoChart.php b/app/Filament/Widgets/Wiki/Video/VideoChart.php index 31ffd5eb9..90cffb778 100644 --- a/app/Filament/Widgets/Wiki/Video/VideoChart.php +++ b/app/Filament/Widgets/Wiki/Video/VideoChart.php @@ -6,7 +6,7 @@ namespace App\Filament\Widgets\Wiki\Video; use App\Filament\Widgets\BaseChartWidget; use App\Models\Wiki\Video; -use Flowframe\Trend\TrendValue; +use App\Services\FlowframeTrend\TrendValue; class VideoChart extends BaseChartWidget { diff --git a/app/GraphQL/Schema/Fields/List/ExternalProfile/ExternalEntry/ExternalEntryWatchStatusField.php b/app/GraphQL/Schema/Fields/List/ExternalProfile/ExternalEntry/ExternalEntryStatusField.php similarity index 50% rename from app/GraphQL/Schema/Fields/List/ExternalProfile/ExternalEntry/ExternalEntryWatchStatusField.php rename to app/GraphQL/Schema/Fields/List/ExternalProfile/ExternalEntry/ExternalEntryStatusField.php index 78698919b..211280f8f 100644 --- a/app/GraphQL/Schema/Fields/List/ExternalProfile/ExternalEntry/ExternalEntryWatchStatusField.php +++ b/app/GraphQL/Schema/Fields/List/ExternalProfile/ExternalEntry/ExternalEntryStatusField.php @@ -4,19 +4,19 @@ declare(strict_types=1); namespace App\GraphQL\Schema\Fields\List\ExternalProfile\ExternalEntry; -use App\Enums\Models\List\ExternalEntryWatchStatus; +use App\Enums\Models\List\ExternalEntryStatus; use App\GraphQL\Schema\Fields\EnumField; use App\Models\List\External\ExternalEntry; -class ExternalEntryWatchStatusField extends EnumField +class ExternalEntryStatusField extends EnumField { public function __construct() { - parent::__construct(ExternalEntry::ATTRIBUTE_WATCH_STATUS, ExternalEntryWatchStatus::class, nullable: false); + parent::__construct(ExternalEntry::ATTRIBUTE_STATUS, ExternalEntryStatus::class, nullable: false); } public function description(): string { - return 'The watch status of the entry on the external site'; + return 'The status of the entry on the external site'; } } diff --git a/app/GraphQL/Schema/Types/List/External/ExternalEntryType.php b/app/GraphQL/Schema/Types/List/External/ExternalEntryType.php index e3cf91eae..900984566 100644 --- a/app/GraphQL/Schema/Types/List/External/ExternalEntryType.php +++ b/app/GraphQL/Schema/Types/List/External/ExternalEntryType.php @@ -10,7 +10,7 @@ use App\GraphQL\Schema\Fields\Base\UpdatedAtField; use App\GraphQL\Schema\Fields\Field; use App\GraphQL\Schema\Fields\List\ExternalProfile\ExternalEntry\ExternalEntryIsFavoriteField; use App\GraphQL\Schema\Fields\List\ExternalProfile\ExternalEntry\ExternalEntryScoreField; -use App\GraphQL\Schema\Fields\List\ExternalProfile\ExternalEntry\ExternalEntryWatchStatusField; +use App\GraphQL\Schema\Fields\List\ExternalProfile\ExternalEntry\ExternalEntryStatusField; use App\GraphQL\Schema\Fields\LocalizedEnumField; use App\GraphQL\Schema\Fields\Relations\BelongsToRelation; use App\GraphQL\Schema\Types\EloquentType; @@ -36,8 +36,8 @@ class ExternalEntryType extends EloquentType new IdField(ExternalEntry::ATTRIBUTE_ID, ExternalEntry::class), new ExternalEntryScoreField(), new ExternalEntryIsFavoriteField(), - new ExternalEntryWatchStatusField(), - new LocalizedEnumField(new ExternalEntryWatchStatusField()), + new ExternalEntryStatusField(), + new LocalizedEnumField(new ExternalEntryStatusField()), new CreatedAtField(), new UpdatedAtField(), diff --git a/app/Http/Api/Field/List/ExternalProfile/ExternalEntry/ExternalEntryWatchStatusField.php b/app/Http/Api/Field/List/ExternalProfile/ExternalEntry/ExternalEntryStatusField.php similarity index 66% rename from app/Http/Api/Field/List/ExternalProfile/ExternalEntry/ExternalEntryWatchStatusField.php rename to app/Http/Api/Field/List/ExternalProfile/ExternalEntry/ExternalEntryStatusField.php index 59c949efa..62ae1d187 100644 --- a/app/Http/Api/Field/List/ExternalProfile/ExternalEntry/ExternalEntryWatchStatusField.php +++ b/app/Http/Api/Field/List/ExternalProfile/ExternalEntry/ExternalEntryStatusField.php @@ -6,25 +6,25 @@ namespace App\Http\Api\Field\List\ExternalProfile\ExternalEntry; use App\Contracts\Http\Api\Field\CreatableField; use App\Contracts\Http\Api\Field\UpdatableField; -use App\Enums\Models\List\ExternalEntryWatchStatus; +use App\Enums\Models\List\ExternalEntryStatus; use App\Http\Api\Field\EnumField; use App\Http\Api\Schema\Schema; use App\Models\List\External\ExternalEntry; use Illuminate\Http\Request; use Illuminate\Validation\Rules\Enum; -class ExternalEntryWatchStatusField extends EnumField implements CreatableField, UpdatableField +class ExternalEntryStatusField extends EnumField implements CreatableField, UpdatableField { public function __construct(Schema $schema) { - parent::__construct($schema, ExternalEntry::ATTRIBUTE_WATCH_STATUS, ExternalEntryWatchStatus::class); + parent::__construct($schema, ExternalEntry::ATTRIBUTE_STATUS, ExternalEntryStatus::class); } public function getCreationRules(Request $request): array { return [ 'required', - new Enum(ExternalEntryWatchStatus::class), + new Enum(ExternalEntryStatus::class), ]; } @@ -33,7 +33,7 @@ class ExternalEntryWatchStatusField extends EnumField implements CreatableField, return [ 'sometimes', 'required', - new Enum(ExternalEntryWatchStatus::class), + new Enum(ExternalEntryStatus::class), ]; } } diff --git a/app/Http/Api/Schema/List/External/ExternalEntrySchema.php b/app/Http/Api/Schema/List/External/ExternalEntrySchema.php index 9fc8d85d3..b1805cb82 100644 --- a/app/Http/Api/Schema/List/External/ExternalEntrySchema.php +++ b/app/Http/Api/Schema/List/External/ExternalEntrySchema.php @@ -12,7 +12,7 @@ use App\Http\Api\Field\List\ExternalProfile\ExternalEntry\ExternalEntryAnimeIdFi use App\Http\Api\Field\List\ExternalProfile\ExternalEntry\ExternalEntryExternalProfileIdField; use App\Http\Api\Field\List\ExternalProfile\ExternalEntry\ExternalEntryIsFavoriteField; use App\Http\Api\Field\List\ExternalProfile\ExternalEntry\ExternalEntryScoreField; -use App\Http\Api\Field\List\ExternalProfile\ExternalEntry\ExternalEntryWatchStatusField; +use App\Http\Api\Field\List\ExternalProfile\ExternalEntry\ExternalEntryStatusField; use App\Http\Api\Include\AllowedInclude; use App\Http\Api\Schema\Auth\UserSchema; use App\Http\Api\Schema\EloquentSchema; @@ -51,7 +51,7 @@ class ExternalEntrySchema extends EloquentSchema new IdField($this, ExternalEntry::ATTRIBUTE_ID), new ExternalEntryScoreField($this), new ExternalEntryIsFavoriteField($this), - new ExternalEntryWatchStatusField($this), + new ExternalEntryStatusField($this), new ExternalEntryAnimeIdField($this), new ExternalEntryExternalProfileIdField($this), ]; diff --git a/app/Http/Controllers/Admin/LatestWikiDumpController.php b/app/Http/Controllers/Admin/LatestContentDumpController.php similarity index 82% rename from app/Http/Controllers/Admin/LatestWikiDumpController.php rename to app/Http/Controllers/Admin/LatestContentDumpController.php index dd7cc7d7f..d63b6d84c 100644 --- a/app/Http/Controllers/Admin/LatestWikiDumpController.php +++ b/app/Http/Controllers/Admin/LatestContentDumpController.php @@ -5,14 +5,14 @@ declare(strict_types=1); namespace App\Http\Controllers\Admin; use App\Actions\Http\Admin\Dump\DumpDownloadAction; -use App\Actions\Storage\Admin\Dump\DumpWikiAction; +use App\Actions\Storage\Admin\Dump\DumpContentAction; use App\Enums\Http\Api\Filter\ComparisonOperator; use App\Http\Controllers\Controller; use App\Models\Admin\Dump; use Illuminate\Database\Eloquent\ModelNotFoundException; use Symfony\Component\HttpFoundation\StreamedResponse; -class LatestWikiDumpController extends Controller +class LatestContentDumpController extends Controller { /** * Download dump. @@ -23,7 +23,7 @@ class LatestWikiDumpController extends Controller { /** @var Dump $dump */ $dump = Dump::query() - ->where(Dump::ATTRIBUTE_PATH, ComparisonOperator::LIKE->value, DumpWikiAction::FILENAME_PREFIX.'%') + ->where(Dump::ATTRIBUTE_PATH, ComparisonOperator::LIKE->value, DumpContentAction::FILENAME_PREFIX.'%') ->latest() ->firstOrFail(); diff --git a/app/Http/Controllers/Api/Auth/User/Me/List/MyExternalProfileController.php b/app/Http/Controllers/Api/Auth/User/Me/List/MyExternalProfileController.php index d75296272..ee7e3bb3e 100644 --- a/app/Http/Controllers/Api/Auth/User/Me/List/MyExternalProfileController.php +++ b/app/Http/Controllers/Api/Auth/User/Me/List/MyExternalProfileController.php @@ -7,14 +7,13 @@ namespace App\Http\Controllers\Api\Auth\User\Me\List; use App\Actions\Http\Api\IndexAction; use App\Http\Api\Query\Query; use App\Http\Api\Schema\List\ExternalProfileSchema; -use App\Http\Api\Schema\Schema; use App\Http\Controllers\Api\BaseController; use App\Http\Middleware\Auth\Authenticate; use App\Http\Requests\Api\IndexRequest; use App\Http\Resources\List\Collection\ExternalProfileCollection; use App\Models\Auth\User; use App\Models\List\ExternalProfile; -use Illuminate\Support\Facades\Auth; +use Illuminate\Container\Attributes\CurrentUser; class MyExternalProfileController extends BaseController { @@ -24,13 +23,10 @@ class MyExternalProfileController extends BaseController parent::__construct(ExternalProfile::class, 'externalprofile'); } - public function index(IndexRequest $request, IndexAction $action): ExternalProfileCollection + public function index(IndexRequest $request, #[CurrentUser] User $user, IndexAction $action): ExternalProfileCollection { $query = new Query($request->validated()); - /** @var User $user */ - $user = Auth::user(); - $builder = $user->externalprofiles()->getQuery(); $profiles = $action->index($builder, $query, $request->schema()); diff --git a/app/Http/Controllers/Api/Auth/User/Me/List/MyNotificationController.php b/app/Http/Controllers/Api/Auth/User/Me/List/MyNotificationController.php index 6a726db1e..80f214519 100644 --- a/app/Http/Controllers/Api/Auth/User/Me/List/MyNotificationController.php +++ b/app/Http/Controllers/Api/Auth/User/Me/List/MyNotificationController.php @@ -6,7 +6,6 @@ namespace App\Http\Controllers\Api\Auth\User\Me\List; use App\Actions\Http\Api\IndexAction; use App\Http\Api\Query\Query; -use App\Http\Api\Schema\Schema; use App\Http\Api\Schema\User\NotificationSchema; use App\Http\Controllers\Api\BaseController; use App\Http\Middleware\Auth\Authenticate; @@ -14,6 +13,7 @@ use App\Http\Requests\Api\IndexRequest; use App\Http\Resources\User\Collection\NotificationCollection; use App\Models\Auth\User; use App\Models\User\Notification; +use Illuminate\Container\Attributes\CurrentUser; use Illuminate\Http\JsonResponse; use Illuminate\Support\Facades\Auth; @@ -25,13 +25,10 @@ class MyNotificationController extends BaseController parent::__construct(Notification::class, 'notification'); } - public function index(IndexRequest $request, IndexAction $action): NotificationCollection + public function index(IndexRequest $request, #[CurrentUser] User $user, IndexAction $action): NotificationCollection { $query = new Query($request->validated()); - /** @var User $user */ - $user = Auth::user(); - $builder = $user->notifications()->getQuery(); $notifications = $action->index($builder, $query, $request->schema()); diff --git a/app/Http/Controllers/Api/Auth/User/Me/List/MyPlaylistController.php b/app/Http/Controllers/Api/Auth/User/Me/List/MyPlaylistController.php index 8378df206..22e20d04a 100644 --- a/app/Http/Controllers/Api/Auth/User/Me/List/MyPlaylistController.php +++ b/app/Http/Controllers/Api/Auth/User/Me/List/MyPlaylistController.php @@ -7,14 +7,13 @@ namespace App\Http\Controllers\Api\Auth\User\Me\List; use App\Actions\Http\Api\IndexAction; use App\Http\Api\Query\Query; use App\Http\Api\Schema\List\PlaylistSchema; -use App\Http\Api\Schema\Schema; use App\Http\Controllers\Api\BaseController; use App\Http\Middleware\Auth\Authenticate; use App\Http\Requests\Api\IndexRequest; use App\Http\Resources\List\Collection\PlaylistCollection; use App\Models\Auth\User; use App\Models\List\Playlist; -use Illuminate\Support\Facades\Auth; +use Illuminate\Container\Attributes\CurrentUser; class MyPlaylistController extends BaseController { @@ -24,13 +23,10 @@ class MyPlaylistController extends BaseController parent::__construct(Playlist::class, 'playlist'); } - public function index(IndexRequest $request, IndexAction $action): PlaylistCollection + public function index(IndexRequest $request, #[CurrentUser] User $user, IndexAction $action): PlaylistCollection { $query = new Query($request->validated()); - /** @var User $user */ - $user = Auth::user(); - $builder = $user->playlists()->getQuery(); $playlists = $action->index($builder, $query, $request->schema()); diff --git a/app/Http/Controllers/Api/Auth/User/Me/MyController.php b/app/Http/Controllers/Api/Auth/User/Me/MyController.php index 4daed0f88..88e1c49f1 100644 --- a/app/Http/Controllers/Api/Auth/User/Me/MyController.php +++ b/app/Http/Controllers/Api/Auth/User/Me/MyController.php @@ -7,13 +7,12 @@ namespace App\Http\Controllers\Api\Auth\User\Me; use App\Actions\Http\Api\ShowAction; use App\Http\Api\Query\Query; use App\Http\Api\Schema\Auth\User\MySchema; -use App\Http\Api\Schema\Schema; use App\Http\Controllers\Api\BaseController; use App\Http\Middleware\Auth\Authenticate; use App\Http\Requests\Api\ShowRequest; use App\Http\Resources\Auth\User\Resource\MyJsonResource; use App\Models\Auth\User; -use Illuminate\Support\Facades\Auth; +use Illuminate\Container\Attributes\CurrentUser; class MyController extends BaseController { @@ -25,13 +24,10 @@ class MyController extends BaseController $this->middleware(Authenticate::using('sanctum')); } - public function show(ShowRequest $request, ShowAction $action): MyJsonResource + public function show(ShowRequest $request, #[CurrentUser] User $user, ShowAction $action): MyJsonResource { $query = new Query($request->validated()); - /** @var User $user */ - $user = Auth::user(); - $show = $action->show($user, $query, $request->schema()); return new MyJsonResource($show, $query); diff --git a/app/Http/Controllers/Api/List/ExternalProfileController.php b/app/Http/Controllers/Api/List/ExternalProfileController.php index a8f8ef029..4ad09caa9 100644 --- a/app/Http/Controllers/Api/List/ExternalProfileController.php +++ b/app/Http/Controllers/Api/List/ExternalProfileController.php @@ -24,7 +24,6 @@ use App\Http\Resources\List\Resource\ExternalProfileJsonResource; use App\Models\List\ExternalProfile; use Illuminate\Http\JsonResponse; use Illuminate\Support\Facades\Auth; -use Illuminate\Support\Str; use Laravel\Pennant\Middleware\EnsureFeaturesAreActive; class ExternalProfileController extends BaseController @@ -33,13 +32,8 @@ class ExternalProfileController extends BaseController { parent::__construct(ExternalProfile::class, 'externalprofile'); - $isExternalProfileManagementAllowed = Str::of(EnsureFeaturesAreActive::class) - ->append(':') - ->append(AllowExternalProfileManagement::class) - ->__toString(); - $this->middleware(EnabledOnlyOnLocalhost::class); - $this->middleware($isExternalProfileManagementAllowed)->except(['index', 'show']); + $this->middleware(EnsureFeaturesAreActive::using(AllowExternalProfileManagement::class))->except(['index', 'show']); $this->middleware(UserExceedsExternalProfileLimit::class)->only(['store', 'restore']); } @@ -49,9 +43,9 @@ class ExternalProfileController extends BaseController $builder = ExternalProfile::query()->where(ExternalProfile::ATTRIBUTE_VISIBILITY, ExternalProfileVisibility::PUBLIC->value); - $userId = Auth::id(); - if ($userId) { - $builder->orWhereBelongsTo(Auth::user()); + $user = Auth::user(); + if ($user) { + $builder->orWhereBelongsTo($user); } $externalprofiles = $query->hasSearchCriteria() diff --git a/app/Http/Controllers/Api/List/Playlist/TrackBackwardController.php b/app/Http/Controllers/Api/List/Playlist/TrackBackwardController.php index 6f0125916..89649eb99 100644 --- a/app/Http/Controllers/Api/List/Playlist/TrackBackwardController.php +++ b/app/Http/Controllers/Api/List/Playlist/TrackBackwardController.php @@ -7,7 +7,6 @@ namespace App\Http\Controllers\Api\List\Playlist; use App\Actions\Http\Api\IndexAction; use App\Http\Api\Query\Query; use App\Http\Api\Schema\List\Playlist\ForwardBackwardSchema; -use App\Http\Api\Schema\Schema; use App\Http\Controllers\Api\BaseController; use App\Http\Requests\Api\List\Playlist\ForwardBackwardIndexRequest; use App\Http\Resources\List\Playlist\Collection\TrackCollection; diff --git a/app/Http/Controllers/Api/List/Playlist/TrackController.php b/app/Http/Controllers/Api/List/Playlist/TrackController.php index 2f6ec8411..db7555f4d 100644 --- a/app/Http/Controllers/Api/List/Playlist/TrackController.php +++ b/app/Http/Controllers/Api/List/Playlist/TrackController.php @@ -23,7 +23,6 @@ use App\Models\List\Playlist; use App\Models\List\Playlist\PlaylistTrack; use Exception; use Illuminate\Http\JsonResponse; -use Illuminate\Support\Str; use Laravel\Pennant\Middleware\EnsureFeaturesAreActive; class TrackController extends BaseController @@ -32,12 +31,7 @@ class TrackController extends BaseController { parent::__construct(PlaylistTrack::class, 'track,playlist'); - $isPlaylistManagementAllowed = Str::of(EnsureFeaturesAreActive::class) - ->append(':') - ->append(AllowPlaylistManagement::class) - ->__toString(); - - $this->middleware($isPlaylistManagementAllowed)->except(['index', 'show']); + $this->middleware(EnsureFeaturesAreActive::using(AllowPlaylistManagement::class))->except(['index', 'show']); $this->middleware(PlaylistExceedsTrackLimit::class)->only(['store', 'restore']); } diff --git a/app/Http/Controllers/Api/List/Playlist/TrackForwardController.php b/app/Http/Controllers/Api/List/Playlist/TrackForwardController.php index e2d0d72bc..61a071495 100644 --- a/app/Http/Controllers/Api/List/Playlist/TrackForwardController.php +++ b/app/Http/Controllers/Api/List/Playlist/TrackForwardController.php @@ -7,7 +7,6 @@ namespace App\Http\Controllers\Api\List\Playlist; use App\Actions\Http\Api\IndexAction; use App\Http\Api\Query\Query; use App\Http\Api\Schema\List\Playlist\ForwardBackwardSchema; -use App\Http\Api\Schema\Schema; use App\Http\Controllers\Api\BaseController; use App\Http\Requests\Api\List\Playlist\ForwardBackwardIndexRequest; use App\Http\Resources\List\Playlist\Collection\TrackCollection; diff --git a/app/Http/Controllers/Api/List/PlaylistController.php b/app/Http/Controllers/Api/List/PlaylistController.php index ce4ab4c0c..635f3ec92 100644 --- a/app/Http/Controllers/Api/List/PlaylistController.php +++ b/app/Http/Controllers/Api/List/PlaylistController.php @@ -23,7 +23,6 @@ use App\Http\Resources\List\Resource\PlaylistJsonResource; use App\Models\List\Playlist; use Illuminate\Http\JsonResponse; use Illuminate\Support\Facades\Auth; -use Illuminate\Support\Str; use Laravel\Pennant\Middleware\EnsureFeaturesAreActive; class PlaylistController extends BaseController @@ -32,12 +31,7 @@ class PlaylistController extends BaseController { parent::__construct(Playlist::class, 'playlist'); - $isPlaylistManagementAllowed = Str::of(EnsureFeaturesAreActive::class) - ->append(':') - ->append(AllowPlaylistManagement::class) - ->__toString(); - - $this->middleware($isPlaylistManagementAllowed)->except(['index', 'show']); + $this->middleware(EnsureFeaturesAreActive::using(AllowPlaylistManagement::class))->except(['index', 'show']); $this->middleware(UserExceedsPlaylistLimit::class)->only(['store', 'restore']); } diff --git a/app/Http/Controllers/Api/List/PlaylistForwardController.php b/app/Http/Controllers/Api/List/PlaylistForwardController.php index 26a1aff07..e5d45ac48 100644 --- a/app/Http/Controllers/Api/List/PlaylistForwardController.php +++ b/app/Http/Controllers/Api/List/PlaylistForwardController.php @@ -7,7 +7,6 @@ namespace App\Http\Controllers\Api\List; use App\Actions\Http\Api\IndexAction; use App\Http\Api\Query\Query; use App\Http\Api\Schema\List\Playlist\ForwardBackwardSchema; -use App\Http\Api\Schema\Schema; use App\Http\Controllers\Api\BaseController; use App\Http\Requests\Api\List\Playlist\ForwardBackwardIndexRequest; use App\Http\Resources\List\Playlist\Collection\TrackCollection; diff --git a/app/Http/Controllers/List/External/ExternalTokenAuthController.php b/app/Http/Controllers/List/External/ExternalTokenAuthController.php index d994927b3..d97b48580 100644 --- a/app/Http/Controllers/List/External/ExternalTokenAuthController.php +++ b/app/Http/Controllers/List/External/ExternalTokenAuthController.php @@ -11,20 +11,14 @@ use App\Http\Middleware\Api\EnabledOnlyOnLocalhost; use App\Http\Requests\List\External\ExternalTokenAuthRequest; use App\Models\List\ExternalProfile; use Illuminate\Http\RedirectResponse; -use Illuminate\Support\Str; use Laravel\Pennant\Middleware\EnsureFeaturesAreActive; class ExternalTokenAuthController extends Controller { public function __construct() { - $isExternalProfileManagementAllowed = Str::of(EnsureFeaturesAreActive::class) - ->append(':') - ->append(AllowExternalProfileManagement::class) - ->__toString(); - $this->middleware(EnabledOnlyOnLocalhost::class); - $this->middleware($isExternalProfileManagementAllowed); + $this->middleware(EnsureFeaturesAreActive::using(AllowExternalProfileManagement::class)); } /** diff --git a/app/Http/Controllers/List/External/ExternalTokenCallbackController.php b/app/Http/Controllers/List/External/ExternalTokenCallbackController.php index d25b5c0e6..c3ead1586 100644 --- a/app/Http/Controllers/List/External/ExternalTokenCallbackController.php +++ b/app/Http/Controllers/List/External/ExternalTokenCallbackController.php @@ -12,20 +12,14 @@ use App\Http\Requests\List\External\ExternalTokenCallbackRequest; use App\Models\List\ExternalProfile; use Illuminate\Http\RedirectResponse; use Illuminate\Support\Facades\Auth; -use Illuminate\Support\Str; use Laravel\Pennant\Middleware\EnsureFeaturesAreActive; class ExternalTokenCallbackController extends Controller { public function __construct() { - $isExternalProfileManagementAllowed = Str::of(EnsureFeaturesAreActive::class) - ->append(':') - ->append(AllowExternalProfileManagement::class) - ->__toString(); - $this->middleware(EnabledOnlyOnLocalhost::class); - $this->middleware($isExternalProfileManagementAllowed); + $this->middleware(EnsureFeaturesAreActive::using(AllowExternalProfileManagement::class)); } /** diff --git a/app/Http/Controllers/List/SyncExternalProfileController.php b/app/Http/Controllers/List/SyncExternalProfileController.php index 94e55e5ca..52f50dc40 100644 --- a/app/Http/Controllers/List/SyncExternalProfileController.php +++ b/app/Http/Controllers/List/SyncExternalProfileController.php @@ -11,21 +11,15 @@ use App\Http\Middleware\Models\List\ExternalProfileSyncLimit; use App\Http\Requests\Api\ShowRequest; use App\Models\List\ExternalProfile; use Illuminate\Http\JsonResponse; -use Illuminate\Support\Str; use Laravel\Pennant\Middleware\EnsureFeaturesAreActive; class SyncExternalProfileController extends Controller { public function __construct() { - $isExternalProfileManagementAllowed = Str::of(EnsureFeaturesAreActive::class) - ->append(':') - ->append(AllowExternalProfileManagement::class) - ->__toString(); - $this->authorizeResource(ExternalProfile::class, 'externalprofile'); $this->middleware(EnabledOnlyOnLocalhost::class); - $this->middleware($isExternalProfileManagementAllowed)->except(['show']); + $this->middleware(EnsureFeaturesAreActive::using(AllowExternalProfileManagement::class))->except(['show']); $this->middleware(ExternalProfileSyncLimit::class)->only('update'); } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 44831517c..fb3168028 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -25,9 +25,9 @@ use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse; use Illuminate\Cookie\Middleware\EncryptCookies; use Illuminate\Foundation\Http\Kernel as HttpKernel; use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull; +use Illuminate\Foundation\Http\Middleware\PreventRequestForgery; use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance; use Illuminate\Foundation\Http\Middleware\ValidatePostSize; -use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken; use Illuminate\Http\Middleware\HandleCors; use Illuminate\Http\Middleware\SetCacheHeaders; use Illuminate\Routing\Middleware\SubstituteBindings; @@ -68,7 +68,7 @@ class Kernel extends HttpKernel AddQueuedCookiesToResponse::class, StartSession::class, ShareErrorsFromSession::class, - VerifyCsrfToken::class, + PreventRequestForgery::class, SubstituteBindings::class, LogRequest::class, ], @@ -78,7 +78,7 @@ class Kernel extends HttpKernel AddQueuedCookiesToResponse::class, StartSession::class, ShareErrorsFromSession::class, - VerifyCsrfToken::class, + PreventRequestForgery::class, SubstituteBindings::class, LogRequest::class, 'auth', diff --git a/app/Jobs/List/SyncExternalProfileJob.php b/app/Jobs/List/SyncExternalProfileJob.php index 12f7908a6..dd7734409 100644 --- a/app/Jobs/List/SyncExternalProfileJob.php +++ b/app/Jobs/List/SyncExternalProfileJob.php @@ -12,12 +12,15 @@ use DateTime; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; +use Illuminate\Queue\Attributes\Backoff; use Illuminate\Queue\Attributes\DeleteWhenMissingModels; use Illuminate\Queue\Attributes\WithoutRelations; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\Middleware\WithoutOverlapping; +use Illuminate\Support\Facades\Date; use Laravel\Pennant\Feature; +#[Backoff(120)] #[DeleteWhenMissingModels] #[WithoutRelations] class SyncExternalProfileJob implements ShouldQueue @@ -26,13 +29,6 @@ class SyncExternalProfileJob implements ShouldQueue use InteractsWithQueue; use Queueable; - /** - * The number of seconds to wait before retrying the queued listener. - * - * @var int - */ - public $backoff = 120; - public function __construct(public readonly ExternalProfile $profile) { $this->onQueue("sync-external-profile-{$profile->site->name}"); @@ -60,6 +56,6 @@ class SyncExternalProfileJob implements ShouldQueue */ public function retryUntil(): DateTime { - return now()->addMinutes(15); + return Date::now()->addMinutes(15); } } diff --git a/app/Jobs/SendDiscordNotificationJob.php b/app/Jobs/SendDiscordNotificationJob.php index 82f1bde91..c19fb5082 100644 --- a/app/Jobs/SendDiscordNotificationJob.php +++ b/app/Jobs/SendDiscordNotificationJob.php @@ -12,11 +12,14 @@ use DateTime; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; +use Illuminate\Queue\Attributes\Backoff; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\Date; use Illuminate\Support\Facades\Notification; use Laravel\Pennant\Feature; +#[Backoff(60)] class SendDiscordNotificationJob implements ShouldQueue { use Dispatchable; @@ -24,13 +27,6 @@ class SendDiscordNotificationJob implements ShouldQueue use Queueable; use SerializesModels; - /** - * The number of seconds to wait before retrying the queued listener. - * - * @var int - */ - public $backoff = 60; - public function __construct(protected readonly DiscordMessageEvent $event) {} public function handle(): void @@ -51,6 +47,6 @@ class SendDiscordNotificationJob implements ShouldQueue */ public function retryUntil(): DateTime { - return now()->addMinutes(15); + return Date::now()->addMinutes(15); } } diff --git a/app/Listeners/Queue/LogQueueBusy.php b/app/Listeners/Queue/LogQueueBusy.php index 3f06af30c..6e3e45eb2 100644 --- a/app/Listeners/Queue/LogQueueBusy.php +++ b/app/Listeners/Queue/LogQueueBusy.php @@ -12,7 +12,7 @@ class LogQueueBusy public function handle(QueueBusy $event): void { Log::info('QueueBusy', [ - 'connection' => $event->connection, + 'connection' => $event->connectionName, 'remember' => $event->queue, 'size' => $event->size, ]); diff --git a/app/Models/Admin/ActionLog.php b/app/Models/Admin/ActionLog.php index 2e729d78f..ca6876d18 100644 --- a/app/Models/Admin/ActionLog.php +++ b/app/Models/Admin/ActionLog.php @@ -14,6 +14,7 @@ use App\Observers\Admin\ActionLogObserver; use Filament\Actions\Action; use Filament\Facades\Filament; use Illuminate\Database\Eloquent\Attributes\ObservedBy; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphTo; @@ -43,6 +44,7 @@ use Throwable; * @property User|null $user */ #[ObservedBy(ActionLogObserver::class)] +#[Table(ActionLog::TABLE, ActionLog::ATTRIBUTE_ID)] class ActionLog extends Model implements Nameable { final public const string TABLE = 'action_logs'; @@ -71,20 +73,6 @@ class ActionLog extends Model implements Nameable final public const string RELATION_USER = 'user'; final public const string RELATION_TARGET = 'target'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = ActionLog::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = ActionLog::ATTRIBUTE_ID; - /** * The attributes that are mass assignable. * diff --git a/app/Models/Admin/Announcement.php b/app/Models/Admin/Announcement.php index caf0b3242..ccc355dd5 100644 --- a/app/Models/Admin/Announcement.php +++ b/app/Models/Admin/Announcement.php @@ -10,6 +10,7 @@ use App\Events\Admin\Announcement\AnnouncementUpdated; use App\Models\BaseModel; use Database\Factories\Admin\AnnouncementFactory; use Illuminate\Database\Eloquent\Attributes\Scope; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Support\Carbon; @@ -26,6 +27,7 @@ use OwenIt\Auditing\Contracts\Auditable; * @method static AnnouncementFactory factory(...$parameters) * @method static Builder current() */ +#[Table(Announcement::TABLE, Announcement::ATTRIBUTE_ID)] class Announcement extends BaseModel implements Auditable { use HasAudits; @@ -38,20 +40,6 @@ class Announcement extends BaseModel implements Auditable final public const string ATTRIBUTE_ID = 'announcement_id'; final public const string ATTRIBUTE_START_AT = 'start_at'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Announcement::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Announcement::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -84,6 +72,7 @@ class Announcement extends BaseModel implements Auditable protected function casts(): array { return [ + Announcement::ATTRIBUTE_CONTENT => 'string', Announcement::ATTRIBUTE_END_AT => 'datetime', Announcement::ATTRIBUTE_START_AT => 'datetime', ]; diff --git a/app/Models/Admin/Dump.php b/app/Models/Admin/Dump.php index d19b68eb6..23ba2f0ba 100644 --- a/app/Models/Admin/Dump.php +++ b/app/Models/Admin/Dump.php @@ -9,7 +9,9 @@ use App\Events\Admin\Dump\DumpDeleted; use App\Events\Admin\Dump\DumpUpdated; use App\Models\BaseModel; use Database\Factories\Admin\DumpFactory; +use Illuminate\Database\Eloquent\Attributes\Appends; use Illuminate\Database\Eloquent\Attributes\Scope; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Factories\HasFactory; @@ -22,6 +24,8 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; * @method static DumpFactory factory(...$parameters) * @method static Builder public() */ +#[Appends([Dump::ATTRIBUTE_LINK])] +#[Table(Dump::TABLE, Dump::ATTRIBUTE_ID)] class Dump extends BaseModel { use HasFactory; @@ -33,20 +37,6 @@ class Dump extends BaseModel final public const string ATTRIBUTE_PUBLIC = 'public'; final public const string ATTRIBUTE_LINK = 'link'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Dump::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Dump::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -70,15 +60,6 @@ class Dump extends BaseModel Dump::ATTRIBUTE_PUBLIC, ]; - /** - * The accessors to append to the model's array form. - * - * @var list - */ - protected $appends = [ - Dump::ATTRIBUTE_LINK, - ]; - /** * Get the attributes that should be cast. * @@ -87,6 +68,7 @@ class Dump extends BaseModel protected function casts(): array { return [ + Dump::ATTRIBUTE_PATH => 'string', Dump::ATTRIBUTE_PUBLIC => 'bool', ]; } diff --git a/app/Models/Admin/Feature.php b/app/Models/Admin/Feature.php index 2a2732f9b..d3bae0c3e 100644 --- a/app/Models/Admin/Feature.php +++ b/app/Models/Admin/Feature.php @@ -10,6 +10,7 @@ use App\Events\Admin\Feature\FeatureDeleted; use App\Events\Admin\Feature\FeatureUpdated; use App\Models\BaseModel; use Database\Factories\Admin\FeatureFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Support\Carbon; @@ -23,6 +24,7 @@ use Illuminate\Support\Carbon; * * @method static FeatureFactory factory(...$parameters) */ +#[Table(Feature::TABLE, Feature::ATTRIBUTE_ID)] class Feature extends BaseModel { use HasFactory; @@ -34,20 +36,6 @@ class Feature extends BaseModel final public const string ATTRIBUTE_SCOPE = 'scope'; final public const string ATTRIBUTE_VALUE = 'value'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Feature::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Feature::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -70,6 +58,20 @@ class Feature extends BaseModel Feature::ATTRIBUTE_VALUE, ]; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + Feature::ATTRIBUTE_NAME => 'string', + Feature::ATTRIBUTE_SCOPE => 'string', + Feature::ATTRIBUTE_VALUE => 'string', + ]; + } + public function getName(): string { return $this->name; diff --git a/app/Models/Admin/FeaturedTheme.php b/app/Models/Admin/FeaturedTheme.php index 07a40313c..0ca594b44 100644 --- a/app/Models/Admin/FeaturedTheme.php +++ b/app/Models/Admin/FeaturedTheme.php @@ -13,6 +13,7 @@ use App\Models\BaseModel; use App\Models\Wiki\Anime\Theme\AnimeThemeEntry; use App\Models\Wiki\Video; use Database\Factories\Admin\FeaturedThemeFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Support\Carbon; @@ -33,6 +34,7 @@ use OwenIt\Auditing\Contracts\Auditable; * * @method static FeaturedThemeFactory factory(...$parameters) */ +#[Table(FeaturedTheme::TABLE, FeaturedTheme::ATTRIBUTE_ID)] class FeaturedTheme extends BaseModel implements Auditable { use HasAudits; @@ -57,20 +59,6 @@ class FeaturedTheme extends BaseModel implements Auditable final public const string RELATION_USER = 'user'; final public const string RELATION_VIDEO = 'video'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = FeaturedTheme::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = FeaturedTheme::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -106,7 +94,10 @@ class FeaturedTheme extends BaseModel implements Auditable { return [ FeaturedTheme::ATTRIBUTE_END_AT => 'datetime', + FeaturedTheme::ATTRIBUTE_ENTRY => 'int', FeaturedTheme::ATTRIBUTE_START_AT => 'datetime', + FeaturedTheme::ATTRIBUTE_USER => 'int', + FeaturedTheme::ATTRIBUTE_VIDEO => 'int', ]; } diff --git a/app/Models/Aggregate/LikeAggregate.php b/app/Models/Aggregate/LikeAggregate.php index b7316aab5..705374f89 100644 --- a/app/Models/Aggregate/LikeAggregate.php +++ b/app/Models/Aggregate/LikeAggregate.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace App\Models\Aggregate; use App\Contracts\Models\Likeable; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\MorphTo; @@ -14,6 +15,7 @@ use Illuminate\Database\Eloquent\Relations\MorphTo; * @property int $likeable_id * @property int $value */ +#[Table(LikeAggregate::TABLE, incrementing: false, timestamps: false)] class LikeAggregate extends Model { final public const string TABLE = 'like_aggregates'; @@ -24,25 +26,18 @@ class LikeAggregate extends Model final public const string ATTRIBUTE_VALUE = 'value'; /** - * The table associated with the model. + * Get the attributes that should be cast. * - * @var string + * @return array */ - protected $table = LikeAggregate::TABLE; - - /** - * Indicates if the IDs are auto-incrementing. - * - * @var bool - */ - public $incrementing = false; - - /** - * Indicates if the model should be timestamped. - * - * @var bool - */ - public $timestamps = false; + protected function casts(): array + { + return [ + LikeAggregate::ATTRIBUTE_LIKEABLE_TYPE => 'string', + LikeAggregate::ATTRIBUTE_LIKEABLE_ID => 'int', + LikeAggregate::ATTRIBUTE_VALUE => 'int', + ]; + } public function likeable(): MorphTo { diff --git a/app/Models/Auth/Permission.php b/app/Models/Auth/Permission.php index 74e0900eb..83f906b4f 100644 --- a/app/Models/Auth/Permission.php +++ b/app/Models/Auth/Permission.php @@ -29,6 +29,19 @@ class Permission extends BasePermission implements Nameable final public const string RELATION_ROLES = 'roles'; final public const string RELATION_USERS = 'users'; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + Permission::ATTRIBUTE_GUARD_NAME => 'string', + Permission::ATTRIBUTE_NAME => 'string', + ]; + } + public function getName(): string { return $this->name; diff --git a/app/Models/Auth/Prohibition.php b/app/Models/Auth/Prohibition.php index e94cf9b7b..0e9e453aa 100644 --- a/app/Models/Auth/Prohibition.php +++ b/app/Models/Auth/Prohibition.php @@ -20,6 +20,18 @@ class Prohibition extends BaseProhibition implements Nameable final public const string RELATION_SANCTIONS = 'sanctions'; final public const string RELATION_USERS = 'users'; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + Prohibition::ATTRIBUTE_NAME => 'string', + ]; + } + public function getName(): string { return $this->name; diff --git a/app/Models/Auth/Role.php b/app/Models/Auth/Role.php index faa437fe1..42a93e98a 100644 --- a/app/Models/Auth/Role.php +++ b/app/Models/Auth/Role.php @@ -47,7 +47,10 @@ class Role extends BaseRole implements Nameable protected function casts(): array { return [ + Role::ATTRIBUTE_COLOR => 'string', Role::ATTRIBUTE_DEFAULT => 'boolean', + Role::ATTRIBUTE_GUARD_NAME => 'string', + Role::ATTRIBUTE_NAME => 'string', Role::ATTRIBUTE_PRIORITY => 'int', ]; } diff --git a/app/Models/Auth/Sanction.php b/app/Models/Auth/Sanction.php index 849f967d4..c13a0b91f 100644 --- a/app/Models/Auth/Sanction.php +++ b/app/Models/Auth/Sanction.php @@ -20,6 +20,18 @@ class Sanction extends BaseSanction implements Nameable final public const string RELATION_PROHIBITIONS = 'prohibitions'; final public const string RELATION_USERS = 'users'; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + Sanction::ATTRIBUTE_NAME => 'string', + ]; + } + public function getName(): string { return $this->name; diff --git a/app/Models/Auth/User.php b/app/Models/Auth/User.php index 3b8303781..57f9208d5 100644 --- a/app/Models/Auth/User.php +++ b/app/Models/Auth/User.php @@ -28,6 +28,8 @@ use Filament\Models\Contracts\HasAvatar; use Filament\Notifications\DatabaseNotification as FilamentNotification; use Filament\Panel; use Illuminate\Contracts\Auth\MustVerifyEmail; +use Illuminate\Database\Eloquent\Attributes\Hidden; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\HasMany; @@ -64,6 +66,13 @@ use Spatie\Permission\Traits\HasRoles; * * @method static UserFactory factory(...$parameters) */ +#[Hidden([ + User::ATTRIBUTE_PASSWORD, + User::ATTRIBUTE_REMEMBER_TOKEN, + User::ATTRIBUTE_TWO_FACTOR_RECOVERY_CODES, + User::ATTRIBUTE_TWO_FACTOR_SECRET, +])] +#[Table(User::TABLE, dateFormat: 'Y-m-d\TH:i:s.u')] class User extends Authenticatable implements FilamentUser, HasAvatar, HasSubtitle, MustVerifyEmail, Nameable, SoftDeletable { use HasApiTokens; @@ -99,13 +108,6 @@ class User extends Authenticatable implements FilamentUser, HasAvatar, HasSubtit final public const string RELATION_ROLES_PERMISSIONS = 'roles.permissions'; final public const string RELATION_WATCH_HISTORY = 'watchHistory'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = User::TABLE; - /** * The event map for the model. * @@ -132,25 +134,6 @@ class User extends Authenticatable implements FilamentUser, HasAvatar, HasSubtit User::ATTRIBUTE_EMAIL_VERIFIED_AT, ]; - /** - * The attributes that should be hidden for serialization. - * - * @var list - */ - protected $hidden = [ - User::ATTRIBUTE_PASSWORD, - User::ATTRIBUTE_REMEMBER_TOKEN, - User::ATTRIBUTE_TWO_FACTOR_RECOVERY_CODES, - User::ATTRIBUTE_TWO_FACTOR_SECRET, - ]; - - /** - * The storage format of the model's date columns. - * - * @var string - */ - protected $dateFormat = 'Y-m-d\TH:i:s.u'; - /** * Get the attributes that should be cast. * @@ -159,8 +142,11 @@ class User extends Authenticatable implements FilamentUser, HasAvatar, HasSubtit protected function casts(): array { return [ + User::ATTRIBUTE_EMAIL => 'string', User::ATTRIBUTE_EMAIL_VERIFIED_AT => 'datetime', + User::ATTRIBUTE_NAME => 'string', User::ATTRIBUTE_PASSWORD => 'hashed', + User::ATTRIBUTE_REMEMBER_TOKEN => 'string', ]; } diff --git a/app/Models/Discord/DiscordThread.php b/app/Models/Discord/DiscordThread.php index 4b74b0b8d..0f012c1aa 100644 --- a/app/Models/Discord/DiscordThread.php +++ b/app/Models/Discord/DiscordThread.php @@ -11,6 +11,7 @@ use App\Models\Wiki\Anime; use App\Observers\Discord\DiscordThreadObserver; use Database\Factories\Discord\DiscordThreadFactory; use Illuminate\Database\Eloquent\Attributes\ObservedBy; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -23,6 +24,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; * @method static DiscordThreadFactory factory(...$parameters) */ #[ObservedBy(DiscordThreadObserver::class)] +#[Table(DiscordThread::TABLE, DiscordThread::ATTRIBUTE_ID, 'string', false)] class DiscordThread extends BaseModel { use HasFactory; @@ -35,34 +37,6 @@ class DiscordThread extends BaseModel final public const string RELATION_ANIME = 'anime'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = DiscordThread::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = DiscordThread::ATTRIBUTE_ID; - - /** - * Indicates if the model's ID is auto-incrementing. - * - * @var bool - */ - public $incrementing = false; - - /** - * The data type of the primary key ID. - * - * @var string - */ - protected $keyType = 'string'; - /** * The event map for the model. * @@ -86,6 +60,19 @@ class DiscordThread extends BaseModel DiscordThread::ATTRIBUTE_NAME, ]; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + DiscordThread::ATTRIBUTE_ANIME => 'int', + DiscordThread::ATTRIBUTE_NAME => 'string', + ]; + } + public function getName(): string { return $this->name; diff --git a/app/Models/Document/Page.php b/app/Models/Document/Page.php index c36a0f087..2b0c7a871 100644 --- a/app/Models/Document/Page.php +++ b/app/Models/Document/Page.php @@ -17,7 +17,9 @@ use App\Models\BaseModel; use App\Pivots\Document\PageRole; use App\Scopes\ReadablePagesScope; use Database\Factories\Document\PageFactory; +use Illuminate\Database\Eloquent\Attributes\Hidden; use Illuminate\Database\Eloquent\Attributes\ScopedBy; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsToMany; @@ -40,7 +42,9 @@ use OwenIt\Auditing\Contracts\Auditable; * * @method static PageFactory factory(...$parameters) */ +#[Hidden([Page::ATTRIBUTE_BODY])] #[ScopedBy(ReadablePagesScope::class)] +#[Table(Page::TABLE, Page::ATTRIBUTE_ID)] class Page extends BaseModel implements Auditable, SoftDeletable { use HasAudits; @@ -63,20 +67,6 @@ class Page extends BaseModel implements Auditable, SoftDeletable final public const string RELATION_ROLES = 'roles'; final public const string RELATION_VIEWER_ROLES = 'viewerRoles'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Page::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Page::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -105,13 +95,20 @@ class Page extends BaseModel implements Auditable, SoftDeletable ]; /** - * The attributes that should be hidden for serialization. + * Get the attributes that should be cast. * - * @var list + * @return array */ - protected $hidden = [ - Page::ATTRIBUTE_BODY, - ]; + protected function casts(): array + { + return [ + Page::ATTRIBUTE_BODY => 'string', + Page::ATTRIBUTE_NAME => 'string', + Page::ATTRIBUTE_NEXT => 'int', + Page::ATTRIBUTE_PREVIOUS => 'int', + Page::ATTRIBUTE_SLUG => 'string', + ]; + } /** * Get the route key for the model. diff --git a/app/Models/List/External/ExternalEntry.php b/app/Models/List/External/ExternalEntry.php index 04a247e87..0869ffaf2 100644 --- a/app/Models/List/External/ExternalEntry.php +++ b/app/Models/List/External/ExternalEntry.php @@ -4,11 +4,12 @@ declare(strict_types=1); namespace App\Models\List\External; -use App\Enums\Models\List\ExternalEntryWatchStatus; +use App\Enums\Models\List\ExternalEntryStatus; use App\Models\BaseModel; use App\Models\List\ExternalProfile; use App\Models\Wiki\Anime; use Database\Factories\List\External\ExternalEntryFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -20,10 +21,11 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; * @property ExternalProfile $externalprofile * @property bool $is_favorite * @property float|null $score - * @property ExternalEntryWatchStatus $watch_status + * @property ExternalEntryStatus $status * * @method static ExternalEntryFactory factory(...$parameters) */ +#[Table(ExternalEntry::TABLE, ExternalEntry::ATTRIBUTE_ID)] class ExternalEntry extends BaseModel { use HasFactory; @@ -35,26 +37,12 @@ class ExternalEntry extends BaseModel final public const string ATTRIBUTE_PROFILE = 'profile_id'; final public const string ATTRIBUTE_IS_FAVORITE = 'is_favorite'; final public const string ATTRIBUTE_SCORE = 'score'; - final public const string ATTRIBUTE_WATCH_STATUS = 'watch_status'; + final public const string ATTRIBUTE_STATUS = 'status'; final public const string RELATION_ANIME = 'anime'; final public const string RELATION_PROFILE = 'externalprofile'; final public const string RELATION_USER = 'externalprofile.user'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = ExternalEntry::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = ExternalEntry::ATTRIBUTE_ID; - /** * The attributes that are mass assignable. * @@ -65,7 +53,7 @@ class ExternalEntry extends BaseModel ExternalEntry::ATTRIBUTE_PROFILE, ExternalEntry::ATTRIBUTE_IS_FAVORITE, ExternalEntry::ATTRIBUTE_SCORE, - ExternalEntry::ATTRIBUTE_WATCH_STATUS, + ExternalEntry::ATTRIBUTE_STATUS, ]; /** @@ -76,8 +64,11 @@ class ExternalEntry extends BaseModel protected function casts(): array { return [ + ExternalEntry::ATTRIBUTE_ANIME => 'int', + ExternalEntry::ATTRIBUTE_PROFILE => 'int', ExternalEntry::ATTRIBUTE_IS_FAVORITE => 'bool', - ExternalEntry::ATTRIBUTE_WATCH_STATUS => ExternalEntryWatchStatus::class, + ExternalEntry::ATTRIBUTE_SCORE => 'float', + ExternalEntry::ATTRIBUTE_STATUS => ExternalEntryStatus::class, ]; } @@ -101,7 +92,7 @@ class ExternalEntry extends BaseModel return [ ExternalEntry::ATTRIBUTE_IS_FAVORITE, ExternalEntry::ATTRIBUTE_SCORE, - ExternalEntry::ATTRIBUTE_WATCH_STATUS, + ExternalEntry::ATTRIBUTE_STATUS, ]; } diff --git a/app/Models/List/External/ExternalToken.php b/app/Models/List/External/ExternalToken.php index e8843dc9c..17a8cb98b 100644 --- a/app/Models/List/External/ExternalToken.php +++ b/app/Models/List/External/ExternalToken.php @@ -8,6 +8,8 @@ use App\Models\Auth\User; use App\Models\BaseModel; use App\Models\List\ExternalProfile; use Database\Factories\List\External\ExternalTokenFactory; +use Illuminate\Database\Eloquent\Attributes\Hidden; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Znck\Eloquent\Relations\BelongsToThrough; @@ -24,6 +26,11 @@ use Znck\Eloquent\Traits\BelongsToThrough as TraitsBelongsToThrough; * * @method static ExternalTokenFactory factory(...$parameters) */ +#[Hidden([ + ExternalToken::ATTRIBUTE_ACCESS_TOKEN, + ExternalToken::ATTRIBUTE_REFRESH_TOKEN, +])] +#[Table(ExternalToken::TABLE, ExternalToken::ATTRIBUTE_ID)] class ExternalToken extends BaseModel { use HasFactory; @@ -40,20 +47,6 @@ class ExternalToken extends BaseModel final public const string RELATION_USER = 'externalprofile.user'; final public const string RELATION_USER_SHALLOW = 'user'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = ExternalToken::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = ExternalToken::ATTRIBUTE_ID; - /** * The attributes that are mass assignable. * @@ -66,14 +59,18 @@ class ExternalToken extends BaseModel ]; /** - * The attributes that should be hidden for serialization. + * Get the attributes that should be cast. * - * @var list + * @return array */ - protected $hidden = [ - ExternalToken::ATTRIBUTE_ACCESS_TOKEN, - ExternalToken::ATTRIBUTE_REFRESH_TOKEN, - ]; + protected function casts(): array + { + return [ + ExternalToken::ATTRIBUTE_ACCESS_TOKEN => 'string', + ExternalToken::ATTRIBUTE_PROFILE => 'int', + ExternalToken::ATTRIBUTE_REFRESH_TOKEN => 'string', + ]; + } public function getName(): string { diff --git a/app/Models/List/ExternalProfile.php b/app/Models/List/ExternalProfile.php index 39c65ad09..ea7faedea 100644 --- a/app/Models/List/ExternalProfile.php +++ b/app/Models/List/ExternalProfile.php @@ -17,6 +17,7 @@ use App\Models\List\External\ExternalEntry; use App\Models\List\External\ExternalToken; use Database\Factories\List\ExternalProfileFactory; use Elastic\ScoutDriverPlus\Searchable; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Prunable; @@ -44,6 +45,7 @@ use Illuminate\Support\Uri; * * @method static ExternalProfileFactory factory(...$parameters) */ +#[Table(ExternalProfile::TABLE, ExternalProfile::ATTRIBUTE_ID)] class ExternalProfile extends BaseModel { use HasFactory; @@ -65,20 +67,6 @@ class ExternalProfile extends BaseModel final public const string RELATION_EXTERNAL_TOKEN = 'externaltoken'; final public const string RELATION_USER = 'user'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = ExternalProfile::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = ExternalProfile::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -114,8 +102,12 @@ class ExternalProfile extends BaseModel protected function casts(): array { return [ + ExternalProfile::ATTRIBUTE_EXTERNAL_USER_ID => 'int', + ExternalProfile::ATTRIBUTE_NAME => 'string', ExternalProfile::ATTRIBUTE_SITE => ExternalProfileSite::class, + ExternalProfile::ATTRIBUTE_SYNCED_AT => 'datetime', ExternalProfile::ATTRIBUTE_VISIBILITY => ExternalProfileVisibility::class, + ExternalProfile::ATTRIBUTE_USER => 'int', ]; } diff --git a/app/Models/List/Playlist.php b/app/Models/List/Playlist.php index 0cd7dde7a..528eda387 100644 --- a/app/Models/List/Playlist.php +++ b/app/Models/List/Playlist.php @@ -21,6 +21,7 @@ use App\Models\Wiki\Image; use App\Pivots\Morph\Imageable; use Database\Factories\List\PlaylistFactory; use Elastic\ScoutDriverPlus\Searchable; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; @@ -43,6 +44,7 @@ use Illuminate\Support\Collection; * * @method static PlaylistFactory factory(...$parameters) */ +#[Table(Playlist::TABLE, Playlist::ATTRIBUTE_ID)] class Playlist extends BaseModel implements HasAggregateLikes, HasHashids, HasImages, Likeable { use AggregatesLike; @@ -66,20 +68,6 @@ class Playlist extends BaseModel implements HasAggregateLikes, HasHashids, HasIm final public const string RELATION_TRACKS = 'tracks'; final public const string RELATION_USER = 'user'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Playlist::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Playlist::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -123,6 +111,12 @@ class Playlist extends BaseModel implements HasAggregateLikes, HasHashids, HasIm protected function casts(): array { return [ + Playlist::ATTRIBUTE_DESCRIPTION => 'string', + Playlist::ATTRIBUTE_FIRST => 'int', + Playlist::ATTRIBUTE_HASHID => 'string', + Playlist::ATTRIBUTE_LAST => 'int', + Playlist::ATTRIBUTE_NAME => 'string', + Playlist::ATTRIBUTE_USER => 'int', Playlist::ATTRIBUTE_VISIBILITY => PlaylistVisibility::class, ]; } diff --git a/app/Models/List/Playlist/BackwardPlaylistTrack.php b/app/Models/List/Playlist/BackwardPlaylistTrack.php index 290615867..303942734 100644 --- a/app/Models/List/Playlist/BackwardPlaylistTrack.php +++ b/app/Models/List/Playlist/BackwardPlaylistTrack.php @@ -4,6 +4,9 @@ declare(strict_types=1); namespace App\Models\List\Playlist; +use Illuminate\Database\Eloquent\Attributes\Table; + +#[Table(PlaylistTrack::TABLE, PlaylistTrack::ATTRIBUTE_ID)] class BackwardPlaylistTrack extends PlaylistTrack { /** diff --git a/app/Models/List/Playlist/ForwardPlaylistTrack.php b/app/Models/List/Playlist/ForwardPlaylistTrack.php index 3ddd6cc85..2fa342f00 100644 --- a/app/Models/List/Playlist/ForwardPlaylistTrack.php +++ b/app/Models/List/Playlist/ForwardPlaylistTrack.php @@ -4,6 +4,9 @@ declare(strict_types=1); namespace App\Models\List\Playlist; +use Illuminate\Database\Eloquent\Attributes\Table; + +#[Table(PlaylistTrack::TABLE, PlaylistTrack::ATTRIBUTE_ID)] class ForwardPlaylistTrack extends PlaylistTrack { /** diff --git a/app/Models/List/Playlist/PlaylistTrack.php b/app/Models/List/Playlist/PlaylistTrack.php index 1d66e3e4f..5ba4d5371 100644 --- a/app/Models/List/Playlist/PlaylistTrack.php +++ b/app/Models/List/Playlist/PlaylistTrack.php @@ -15,6 +15,7 @@ use App\Models\List\Playlist; use App\Models\Wiki\Anime\Theme\AnimeThemeEntry; use App\Models\Wiki\Video; use Database\Factories\List\Playlist\PlaylistTrackFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -39,6 +40,7 @@ use Staudenmeir\LaravelAdjacencyList\Eloquent\HasRecursiveRelationships; * * @method static PlaylistTrackFactory factory(...$parameters) */ +#[Table(PlaylistTrack::TABLE, PlaylistTrack::ATTRIBUTE_ID)] class PlaylistTrack extends BaseModel implements HasHashids, InteractsWithSchema, Sortable { use HasFactory; @@ -65,20 +67,6 @@ class PlaylistTrack extends BaseModel implements HasHashids, InteractsWithSchema final public const string RELATION_THEME_GROUP = 'animethemeentry.animetheme.group'; final public const string RELATION_VIDEO = 'video'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = PlaylistTrack::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = PlaylistTrack::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -112,7 +100,10 @@ class PlaylistTrack extends BaseModel implements HasHashids, InteractsWithSchema protected function casts(): array { return [ + PlaylistTrack::ATTRIBUTE_ENTRY => 'int', + PlaylistTrack::ATTRIBUTE_PLAYLIST => 'int', PlaylistTrack::ATTRIBUTE_POSITION => 'int', + PlaylistTrack::ATTRIBUTE_VIDEO => 'int', ]; } diff --git a/app/Models/User/Like.php b/app/Models/User/Like.php index 1ed9e0291..1a4966c29 100644 --- a/app/Models/User/Like.php +++ b/app/Models/User/Like.php @@ -7,6 +7,7 @@ namespace App\Models\User; use App\Models\Auth\User; use App\Models\BaseModel; use Database\Factories\User\LikeFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -21,6 +22,7 @@ use Illuminate\Database\Eloquent\Relations\MorphTo; * * @method static LikeFactory factory(...$parameters) */ +#[Table(Like::TABLE, Like::ATTRIBUTE_ID)] class Like extends BaseModel { use HasFactory; @@ -37,20 +39,6 @@ class Like extends BaseModel final public const string RELATION_USER = 'user'; final public const string RELATION_LIKEABLE = 'likeable'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Like::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Like::ATTRIBUTE_ID; - /** * The attributes that are mass assignable. * @@ -62,6 +50,20 @@ class Like extends BaseModel Like::ATTRIBUTE_LIKEABLE_ID, ]; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + Like::ATTRIBUTE_LIKEABLE_TYPE => 'string', + Like::ATTRIBUTE_LIKEABLE_ID => 'int', + Like::ATTRIBUTE_USER => 'int', + ]; + } + public function getName(): string { return strval($this->getKey()); diff --git a/app/Models/User/Submission.php b/app/Models/User/Submission.php index 60d61dadf..c7ea38564 100644 --- a/app/Models/User/Submission.php +++ b/app/Models/User/Submission.php @@ -10,6 +10,7 @@ use App\Models\BaseModel; use App\Models\User\Submission\SubmissionStage; use Database\Factories\User\SubmissionFactory; use Illuminate\Database\Eloquent\Attributes\Scope; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -34,6 +35,7 @@ use Illuminate\Support\Collection; * @method static Builder pending() * @method static SubmissionFactory factory(...$parameters) */ +#[Table(Submission::TABLE, Submission::ATTRIBUTE_ID)] class Submission extends BaseModel { use HasFactory; @@ -56,20 +58,6 @@ class Submission extends BaseModel final public const string RELATION_STAGES = 'stages'; final public const string RELATION_USER = 'user'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Submission::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Submission::ATTRIBUTE_ID; - /** * The attributes that are mass assignable. * @@ -95,9 +83,15 @@ class Submission extends BaseModel protected function casts(): array { return [ + Submission::ATTRIBUTE_ACTIONABLE_TYPE => 'string', + Submission::ATTRIBUTE_ACTIONABLE_ID => 'int', Submission::ATTRIBUTE_FINISHED_AT => 'datetime', Submission::ATTRIBUTE_LOCKED => 'bool', + Submission::ATTRIBUTE_MODERATOR => 'int', + Submission::ATTRIBUTE_MODERATOR_NOTES => 'string', Submission::ATTRIBUTE_STATUS => SubmissionStatus::class, + Submission::ATTRIBUTE_TYPE => 'string', + Submission::ATTRIBUTE_USER => 'int', ]; } diff --git a/app/Models/User/Submission/SubmissionStage.php b/app/Models/User/Submission/SubmissionStage.php index 2df28aeab..f89b57dab 100644 --- a/app/Models/User/Submission/SubmissionStage.php +++ b/app/Models/User/Submission/SubmissionStage.php @@ -8,6 +8,7 @@ use App\Models\Auth\User; use App\Models\BaseModel; use App\Models\User\Submission; use Database\Factories\User\Submission\SubmissionStageFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -24,6 +25,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; * * @method static SubmissionStageFactory factory(...$parameters) */ +#[Table(SubmissionStage::TABLE, SubmissionStage::ATTRIBUTE_ID)] class SubmissionStage extends BaseModel { use HasFactory; @@ -42,20 +44,6 @@ class SubmissionStage extends BaseModel final public const string RELATION_MODERATOR = 'moderator'; final public const string RELATION_SUBMISSION = 'submission'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = SubmissionStage::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = SubmissionStage::ATTRIBUTE_ID; - /** * The attributes that are mass assignable. * @@ -70,6 +58,23 @@ class SubmissionStage extends BaseModel SubmissionStage::ATTRIBUTE_SUBMISSION, ]; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + SubmissionStage::ATTRIBUTE_FIELDS => 'array', + SubmissionStage::ATTRIBUTE_MODERATOR => 'int', + SubmissionStage::ATTRIBUTE_MODERATOR_NOTES => 'string', + SubmissionStage::ATTRIBUTE_NOTES => 'string', + SubmissionStage::ATTRIBUTE_STAGE => 'int', + SubmissionStage::ATTRIBUTE_SUBMISSION => 'int', + ]; + } + public function getName(): string { return strval($this->getKey()); @@ -80,19 +85,6 @@ class SubmissionStage extends BaseModel return strval($this->getKey()); } - /** - * Get the attributes that should be cast. - * - * @return array - */ - protected function casts(): array - { - return [ - SubmissionStage::ATTRIBUTE_FIELDS => 'array', - SubmissionStage::ATTRIBUTE_STAGE => 'int', - ]; - } - /** * @return BelongsTo */ diff --git a/app/Models/User/Submission/SubmissionVirtual.php b/app/Models/User/Submission/SubmissionVirtual.php index 43492c883..18b5fa428 100644 --- a/app/Models/User/Submission/SubmissionVirtual.php +++ b/app/Models/User/Submission/SubmissionVirtual.php @@ -7,7 +7,9 @@ namespace App\Models\User\Submission; use App\Models\Auth\User; use App\Models\BaseModel; use App\Observers\User\Submission\SubmissionVirtualObserver; +use Illuminate\Database\Eloquent\Attributes\Appends; use Illuminate\Database\Eloquent\Attributes\ObservedBy; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -22,7 +24,9 @@ use Illuminate\Database\Eloquent\Relations\Relation; * @property int $user_id * @property User $user */ +#[Appends(['model'])] #[ObservedBy(SubmissionVirtualObserver::class)] +#[Table(SubmissionVirtual::TABLE, SubmissionVirtual::ATTRIBUTE_ID)] class SubmissionVirtual extends BaseModel { final public const string TABLE = 'submission_virtuals'; @@ -36,20 +40,6 @@ class SubmissionVirtual extends BaseModel final public const string RELATION_USER = 'user'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = SubmissionVirtual::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = SubmissionVirtual::ATTRIBUTE_ID; - /** * The attributes that are mass assignable. * @@ -62,9 +52,20 @@ class SubmissionVirtual extends BaseModel SubmissionVirtual::ATTRIBUTE_USER, ]; - protected $appends = [ - 'model', - ]; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + SubmissionVirtual::ATTRIBUTE_EXISTS => 'boolean', + SubmissionVirtual::ATTRIBUTE_FIELDS => 'array', + SubmissionVirtual::ATTRIBUTE_MODEL_TYPE => 'string', + SubmissionVirtual::ATTRIBUTE_USER => 'int', + ]; + } public function getName(): string { @@ -81,19 +82,6 @@ class SubmissionVirtual extends BaseModel return Attribute::make(fn () => Relation::getMorphedModel($this->model_type) ?? $this->model_type); } - /** - * Get the attributes that should be cast. - * - * @return array - */ - protected function casts(): array - { - return [ - SubmissionVirtual::ATTRIBUTE_EXISTS => 'boolean', - SubmissionVirtual::ATTRIBUTE_FIELDS => 'array', - ]; - } - /** * @return BelongsTo */ diff --git a/app/Models/User/WatchHistory.php b/app/Models/User/WatchHistory.php index 0d104f8c1..355953c3d 100644 --- a/app/Models/User/WatchHistory.php +++ b/app/Models/User/WatchHistory.php @@ -9,6 +9,7 @@ use App\Models\BaseModel; use App\Models\Wiki\Anime\Theme\AnimeThemeEntry; use App\Models\Wiki\Video; use Database\Factories\User\WatchHistoryFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -22,6 +23,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; * * @method static WatchHistoryFactory factory(...$parameters) */ +#[Table(WatchHistory::TABLE, WatchHistory::ATTRIBUTE_ID)] class WatchHistory extends BaseModel { use HasFactory; @@ -37,20 +39,6 @@ class WatchHistory extends BaseModel final public const string RELATION_USER = 'user'; final public const string RELATION_VIDEO = 'video'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = WatchHistory::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = WatchHistory::ATTRIBUTE_ID; - /** * The attributes that are mass assignable. * @@ -62,6 +50,20 @@ class WatchHistory extends BaseModel WatchHistory::ATTRIBUTE_VIDEO, ]; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + WatchHistory::ATTRIBUTE_ENTRY => 'int', + WatchHistory::ATTRIBUTE_USER => 'int', + WatchHistory::ATTRIBUTE_VIDEO => 'int', + ]; + } + public function getName(): string { return strval($this->getKey()); diff --git a/app/Models/Wiki/Anime.php b/app/Models/Wiki/Anime.php index 66f71c12f..b661806c4 100644 --- a/app/Models/Wiki/Anime.php +++ b/app/Models/Wiki/Anime.php @@ -31,6 +31,7 @@ use App\Pivots\Wiki\AnimeStudio; use Database\Factories\Wiki\AnimeFactory; use Deprecated; use Elastic\ScoutDriverPlus\Searchable; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsToMany; @@ -61,6 +62,7 @@ use OwenIt\Auditing\Contracts\Auditable; * * @method static AnimeFactory factory(...$parameters) */ +#[Table(Anime::TABLE, Anime::ATTRIBUTE_ID)] class Anime extends BaseModel implements Auditable, HasImages, HasResources, HasSynonyms, SoftDeletable { use HasAudits; @@ -96,20 +98,6 @@ class Anime extends BaseModel implements Auditable, HasImages, HasResources, Has final public const string RELATION_THEMES = 'animethemes'; final public const string RELATION_VIDEOS = 'animethemes.animethemeentries.videos'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Anime::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Anime::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -147,9 +135,12 @@ class Anime extends BaseModel implements Auditable, HasImages, HasResources, Has protected function casts(): array { return [ - Anime::ATTRIBUTE_SEASON => AnimeSeason::class, - Anime::ATTRIBUTE_YEAR => 'int', + Anime::ATTRIBUTE_NAME => 'string', Anime::ATTRIBUTE_MEDIA_FORMAT => AnimeMediaFormat::class, + Anime::ATTRIBUTE_SEASON => AnimeSeason::class, + Anime::ATTRIBUTE_SLUG => 'string', + Anime::ATTRIBUTE_SYNOPSIS => 'string', + Anime::ATTRIBUTE_YEAR => 'int', ]; } diff --git a/app/Models/Wiki/Anime/AnimeSynonym.php b/app/Models/Wiki/Anime/AnimeSynonym.php index 7ae7b40de..9a0d73dea 100644 --- a/app/Models/Wiki/Anime/AnimeSynonym.php +++ b/app/Models/Wiki/Anime/AnimeSynonym.php @@ -11,6 +11,7 @@ use App\Enums\Models\Wiki\AnimeSynonymType; use App\Models\BaseModel; use App\Models\Wiki\Anime; use Elastic\ScoutDriverPlus\Searchable; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; use OwenIt\Auditing\Auditable as HasAudits; @@ -25,6 +26,7 @@ use OwenIt\Auditing\Contracts\Auditable; * * @deprecated Use Synonym instead. */ +#[Table(AnimeSynonym::TABLE, AnimeSynonym::ATTRIBUTE_ID)] class AnimeSynonym extends BaseModel implements Auditable, SoftDeletable { use HasAudits; @@ -44,20 +46,6 @@ class AnimeSynonym extends BaseModel implements Auditable, SoftDeletable final public const string RELATION_SERIES = 'anime.series'; final public const string RELATION_VIDEOS = 'anime.animethemes.animethemeentries.videos'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = AnimeSynonym::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = AnimeSynonym::ATTRIBUTE_ID; - /** * The attributes that are mass assignable. * @@ -77,6 +65,8 @@ class AnimeSynonym extends BaseModel implements Auditable, SoftDeletable protected function casts(): array { return [ + AnimeSynonym::ATTRIBUTE_ANIME => 'int', + AnimeSynonym::ATTRIBUTE_TEXT => 'string', AnimeSynonym::ATTRIBUTE_TYPE => AnimeSynonymType::class, ]; } diff --git a/app/Models/Wiki/Anime/AnimeTheme.php b/app/Models/Wiki/Anime/AnimeTheme.php index 3b51a3703..b716de70f 100644 --- a/app/Models/Wiki/Anime/AnimeTheme.php +++ b/app/Models/Wiki/Anime/AnimeTheme.php @@ -15,7 +15,6 @@ use App\Events\Wiki\Anime\Theme\ThemeDeleting; use App\Events\Wiki\Anime\Theme\ThemeRestored; use App\Events\Wiki\Anime\Theme\ThemeUpdated; use App\Http\Api\Schema\Wiki\Anime\ThemeSchema; -use App\Http\Middleware\Api\SetServingJsonApi; use App\Models\BaseModel; use App\Models\Wiki\Anime; use App\Models\Wiki\Anime\Theme\AnimeThemeEntry; @@ -26,6 +25,8 @@ use App\Scopes\WithoutInsertSongScope; use Database\Factories\Wiki\Anime\AnimeThemeFactory; use Elastic\ScoutDriverPlus\Searchable; use Illuminate\Database\Eloquent\Attributes\ObservedBy; +use Illuminate\Database\Eloquent\Attributes\ScopedBy; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -52,6 +53,8 @@ use OwenIt\Auditing\Contracts\Auditable; * @method static AnimeThemeFactory factory(...$parameters) */ #[ObservedBy(AnimeThemeObserver::class)] +#[ScopedBy(WithoutInsertSongScope::class)] +#[Table(AnimeTheme::TABLE, AnimeTheme::ATTRIBUTE_ID)] class AnimeTheme extends BaseModel implements Auditable, InteractsWithSchema, SoftDeletable { use HasAudits; @@ -82,32 +85,6 @@ class AnimeTheme extends BaseModel implements Auditable, InteractsWithSchema, So final public const string RELATION_SYNONYMS = 'anime.synonyms'; final public const string RELATION_VIDEOS = 'animethemeentries.videos'; - /** - * The "boot" method of the model. - */ - protected static function boot(): void - { - parent::boot(); - - if (SetServingJsonApi::$isServing) { - static::addGlobalScope(new WithoutInsertSongScope); - } - } - - /** - * The table associated with the model. - * - * @var string - */ - protected $table = AnimeTheme::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = AnimeTheme::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -145,7 +122,10 @@ class AnimeTheme extends BaseModel implements Auditable, InteractsWithSchema, So protected function casts(): array { return [ + AnimeTheme::ATTRIBUTE_ANIME => 'int', + AnimeTheme::ATTRIBUTE_GROUP => 'int', AnimeTheme::ATTRIBUTE_SEQUENCE => 'int', + AnimeTheme::ATTRIBUTE_SLUG => 'string', AnimeTheme::ATTRIBUTE_SONG => 'int', AnimeTheme::ATTRIBUTE_TYPE => ThemeType::class, ]; diff --git a/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php b/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php index 853cf4f1e..434bae19f 100644 --- a/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php +++ b/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php @@ -32,6 +32,7 @@ use App\Pivots\Morph\Resourceable; use App\Pivots\Wiki\AnimeThemeEntryVideo; use Database\Factories\Wiki\Anime\Theme\AnimeThemeEntryFactory; use Elastic\ScoutDriverPlus\Searchable; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -61,6 +62,7 @@ use Znck\Eloquent\Traits\BelongsToThrough as ZnckBelongsToThrough; * * @method static AnimeThemeEntryFactory factory(...$parameters) */ +#[Table(AnimeThemeEntry::TABLE, AnimeThemeEntry::ATTRIBUTE_ID)] class AnimeThemeEntry extends BaseModel implements Auditable, HasAggregateLikes, HasResources, InteractsWithSchema, Likeable, SoftDeletable { use AggregatesLike; @@ -93,20 +95,6 @@ class AnimeThemeEntry extends BaseModel implements Auditable, HasAggregateLikes, final public const string RELATION_TRACKS = 'tracks'; final public const string RELATION_VIDEOS = 'videos'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = AnimeThemeEntry::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = AnimeThemeEntry::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -144,8 +132,11 @@ class AnimeThemeEntry extends BaseModel implements Auditable, HasAggregateLikes, protected function casts(): array { return [ + AnimeThemeEntry::ATTRIBUTE_EPISODES => 'string', + AnimeThemeEntry::ATTRIBUTE_NOTES => 'string', AnimeThemeEntry::ATTRIBUTE_NSFW => 'boolean', AnimeThemeEntry::ATTRIBUTE_SPOILER => 'boolean', + AnimeThemeEntry::ATTRIBUTE_THEME => 'int', AnimeThemeEntry::ATTRIBUTE_VERSION => 'int', ]; } diff --git a/app/Models/Wiki/Artist.php b/app/Models/Wiki/Artist.php index bec2bf447..b5d1a803b 100644 --- a/app/Models/Wiki/Artist.php +++ b/app/Models/Wiki/Artist.php @@ -27,6 +27,7 @@ use App\Pivots\Wiki\ArtistSong; use Database\Factories\Wiki\ArtistFactory; use Deprecated; use Elastic\ScoutDriverPlus\Searchable; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsToMany; @@ -56,6 +57,7 @@ use Staudenmeir\EloquentHasManyDeep\HasRelationships; * * @method static ArtistFactory factory(...$parameters) */ +#[Table(Artist::TABLE, Artist::ATTRIBUTE_ID)] class Artist extends BaseModel implements Auditable, HasImages, HasResources, HasSynonyms, SoftDeletable { use HasAudits; @@ -90,20 +92,6 @@ class Artist extends BaseModel implements Auditable, HasImages, HasResources, Ha final public const string RELATION_THEME_GROUPS = 'songs.animethemes.group'; final public const string RELATION_UNIQUE_GROUPSHIPS_PERFORMANCES = 'uniquegroupshipperformances'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Artist::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Artist::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -130,6 +118,20 @@ class Artist extends BaseModel implements Auditable, HasImages, HasResources, Ha Artist::ATTRIBUTE_INFORMATION, ]; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + Artist::ATTRIBUTE_INFORMATION => 'string', + Artist::ATTRIBUTE_NAME => 'string', + Artist::ATTRIBUTE_SLUG => 'string', + ]; + } + /** * Modify the query used to retrieve models when making all of the models searchable. */ diff --git a/app/Models/Wiki/Audio.php b/app/Models/Wiki/Audio.php index f43ccc87e..85e24c2f4 100644 --- a/app/Models/Wiki/Audio.php +++ b/app/Models/Wiki/Audio.php @@ -15,6 +15,8 @@ use App\Events\Wiki\Audio\AudioRestored; use App\Events\Wiki\Audio\AudioUpdated; use App\Models\BaseModel; use Database\Factories\Wiki\AudioFactory; +use Illuminate\Database\Eloquent\Attributes\Appends; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\HasMany; @@ -34,6 +36,8 @@ use OwenIt\Auditing\Contracts\Auditable; * * @method static AudioFactory factory(...$parameters) */ +#[Appends([Audio::ATTRIBUTE_LINK])] +#[Table(Audio::TABLE, Audio::ATTRIBUTE_ID)] class Audio extends BaseModel implements Auditable, SoftDeletable, Streamable { use HasAudits; @@ -53,20 +57,6 @@ class Audio extends BaseModel implements Auditable, SoftDeletable, Streamable final public const string RELATION_VIDEOS = 'videos'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Audio::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Audio::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -95,15 +85,6 @@ class Audio extends BaseModel implements Auditable, SoftDeletable, Streamable Audio::ATTRIBUTE_SIZE, ]; - /** - * The accessors to append to the model's array form. - * - * @var list - */ - protected $appends = [ - Audio::ATTRIBUTE_LINK, - ]; - /** * Get the attributes that should be cast. * @@ -112,6 +93,10 @@ class Audio extends BaseModel implements Auditable, SoftDeletable, Streamable protected function casts(): array { return [ + Audio::ATTRIBUTE_BASENAME => 'string', + Audio::ATTRIBUTE_FILENAME => 'string', + Audio::ATTRIBUTE_MIMETYPE => 'string', + Audio::ATTRIBUTE_PATH => 'string', Audio::ATTRIBUTE_SIZE => 'int', ]; } diff --git a/app/Models/Wiki/ExternalResource.php b/app/Models/Wiki/ExternalResource.php index ee1694c28..226f27415 100644 --- a/app/Models/Wiki/ExternalResource.php +++ b/app/Models/Wiki/ExternalResource.php @@ -16,6 +16,7 @@ use App\Models\BaseModel; use App\Models\Wiki\Anime\Theme\AnimeThemeEntry; use App\Pivots\Morph\Resourceable; use Database\Factories\Wiki\ExternalResourceFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Casts\AsUri; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\MorphToMany; @@ -36,6 +37,7 @@ use OwenIt\Auditing\Contracts\Auditable; * * @method static ExternalResourceFactory factory(...$parameters) */ +#[Table(ExternalResource::TABLE, ExternalResource::ATTRIBUTE_ID)] class ExternalResource extends BaseModel implements Auditable, SoftDeletable { use HasAudits; @@ -56,20 +58,6 @@ class ExternalResource extends BaseModel implements Auditable, SoftDeletable final public const string RELATION_SONGS = 'songs'; final public const string RELATION_STUDIOS = 'studios'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = ExternalResource::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = ExternalResource::ATTRIBUTE_ID; - /** * The event map for the model. * diff --git a/app/Models/Wiki/Group.php b/app/Models/Wiki/Group.php index 2071950e8..be0c819dc 100644 --- a/app/Models/Wiki/Group.php +++ b/app/Models/Wiki/Group.php @@ -15,6 +15,7 @@ use App\Events\Wiki\Group\GroupUpdated; use App\Models\BaseModel; use App\Models\Wiki\Anime\AnimeTheme; use Database\Factories\Wiki\GroupFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Collection; @@ -29,6 +30,7 @@ use OwenIt\Auditing\Contracts\Auditable; * * @method static GroupFactory factory(...$parameters) */ +#[Table(Group::TABLE, Group::ATTRIBUTE_ID)] class Group extends BaseModel implements Auditable, SoftDeletable { use HasAudits; @@ -46,20 +48,6 @@ class Group extends BaseModel implements Auditable, SoftDeletable final public const string RELATION_THEMES = 'animethemes'; final public const string RELATION_VIDEOS = 'animethemes.animethemeentries.videos'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Group::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Group::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -85,6 +73,19 @@ class Group extends BaseModel implements Auditable, SoftDeletable Group::ATTRIBUTE_SLUG, ]; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + Group::ATTRIBUTE_NAME => 'string', + Group::ATTRIBUTE_SLUG => 'string', + ]; + } + public function getName(): string { return $this->name; diff --git a/app/Models/Wiki/Image.php b/app/Models/Wiki/Image.php index 24cbae65c..b97c1cb71 100644 --- a/app/Models/Wiki/Image.php +++ b/app/Models/Wiki/Image.php @@ -17,6 +17,8 @@ use App\Models\BaseModel; use App\Models\List\Playlist; use App\Pivots\Morph\Imageable; use Database\Factories\Wiki\ImageFactory; +use Illuminate\Database\Eloquent\Attributes\Appends; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\MorphToMany; @@ -40,6 +42,8 @@ use OwenIt\Auditing\Contracts\Auditable; * * @method static ImageFactory factory(...$parameters) */ +#[Appends([Image::ATTRIBUTE_LINK])] +#[Table(Image::TABLE, Image::ATTRIBUTE_ID)] class Image extends BaseModel implements Auditable, SoftDeletable { use HasAudits; @@ -59,20 +63,6 @@ class Image extends BaseModel implements Auditable, SoftDeletable final public const string RELATION_PLAYLISTS = 'playlists'; final public const string RELATION_STUDIOS = 'studios'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Image::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Image::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -98,15 +88,6 @@ class Image extends BaseModel implements Auditable, SoftDeletable Image::ATTRIBUTE_PATH, ]; - /** - * The accessors to append to the model's array form. - * - * @var list - */ - protected $appends = [ - Image::ATTRIBUTE_LINK, - ]; - /** * Get the attributes that should be cast. * @@ -116,6 +97,7 @@ class Image extends BaseModel implements Auditable, SoftDeletable { return [ Image::ATTRIBUTE_FACET => ImageFacet::class, + Image::ATTRIBUTE_PATH => 'string', ]; } diff --git a/app/Models/Wiki/Series.php b/app/Models/Wiki/Series.php index 41d6371f3..52ff6b2e7 100644 --- a/app/Models/Wiki/Series.php +++ b/app/Models/Wiki/Series.php @@ -16,6 +16,7 @@ use App\Models\BaseModel; use App\Pivots\Wiki\AnimeSeries; use Database\Factories\Wiki\SeriesFactory; use Elastic\ScoutDriverPlus\Searchable; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsToMany; @@ -31,6 +32,7 @@ use OwenIt\Auditing\Contracts\Auditable; * * @method static SeriesFactory factory(...$parameters) */ +#[Table(Series::TABLE, Series::ATTRIBUTE_ID)] class Series extends BaseModel implements Auditable, SoftDeletable { use HasAudits; @@ -48,20 +50,6 @@ class Series extends BaseModel implements Auditable, SoftDeletable final public const string RELATION_ANIME = 'anime'; final public const string RELATION_ANIME_SYNONYMS = 'anime.synonyms'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Series::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Series::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -86,6 +74,19 @@ class Series extends BaseModel implements Auditable, SoftDeletable Series::ATTRIBUTE_SLUG, ]; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + Series::ATTRIBUTE_NAME => 'string', + Series::ATTRIBUTE_SLUG => 'string', + ]; + } + /** * Modify the query used to retrieve models when making all of the models searchable. */ diff --git a/app/Models/Wiki/Song.php b/app/Models/Wiki/Song.php index 956e771d1..f704a4f69 100644 --- a/app/Models/Wiki/Song.php +++ b/app/Models/Wiki/Song.php @@ -22,6 +22,7 @@ use App\Pivots\Wiki\ArtistSong; use Database\Factories\Wiki\SongFactory; use Deprecated; use Elastic\ScoutDriverPlus\Searchable; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\HasMany; @@ -41,6 +42,7 @@ use OwenIt\Auditing\Contracts\Auditable; * * @method static SongFactory factory(...$parameters) */ +#[Table(Song::TABLE, Song::ATTRIBUTE_ID)] class Song extends BaseModel implements Auditable, HasResources, SoftDeletable { use HasAudits; @@ -64,20 +66,6 @@ class Song extends BaseModel implements Auditable, HasResources, SoftDeletable final public const string RELATION_THEME_GROUPS = 'animethemes.group'; final public const string RELATION_VIDEOS = 'animethemes.animethemeentries.videos'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Song::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Song::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -103,6 +91,19 @@ class Song extends BaseModel implements Auditable, HasResources, SoftDeletable Song::ATTRIBUTE_TITLE_NATIVE, ]; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + Song::ATTRIBUTE_TITLE => 'string', + Song::ATTRIBUTE_TITLE_NATIVE => 'string', + ]; + } + public function getName(): string { if (blank($this->title)) { diff --git a/app/Models/Wiki/Song/Membership.php b/app/Models/Wiki/Song/Membership.php index 2de1222ac..ea188ba2d 100644 --- a/app/Models/Wiki/Song/Membership.php +++ b/app/Models/Wiki/Song/Membership.php @@ -15,6 +15,7 @@ use App\Events\Wiki\Song\Membership\MembershipUpdated; use App\Models\BaseModel; use App\Models\Wiki\Artist; use Database\Factories\Wiki\Song\MembershipFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphMany; @@ -34,6 +35,7 @@ use OwenIt\Auditing\Contracts\Auditable; * * @method static MembershipFactory factory(...$parameters) */ +#[Table(Membership::TABLE, Membership::ATTRIBUTE_ID)] class Membership extends BaseModel implements Auditable, SoftDeletable { use HasAudits; @@ -53,20 +55,6 @@ class Membership extends BaseModel implements Auditable, SoftDeletable final public const string RELATION_MEMBER = 'member'; final public const string RELATION_PERFORMANCES = 'performances'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Membership::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Membership::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -94,6 +82,21 @@ class Membership extends BaseModel implements Auditable, SoftDeletable Membership::ATTRIBUTE_MEMBER, ]; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + Membership::ATTRIBUTE_ALIAS => 'string', + Membership::ATTRIBUTE_ARTIST => 'int', + Membership::ATTRIBUTE_AS => 'string', + Membership::ATTRIBUTE_MEMBER => 'int', + ]; + } + public function getName(): string { return strval($this->getKey()); diff --git a/app/Models/Wiki/Song/Performance.php b/app/Models/Wiki/Song/Performance.php index 0890f4918..c2bf245bc 100644 --- a/app/Models/Wiki/Song/Performance.php +++ b/app/Models/Wiki/Song/Performance.php @@ -16,6 +16,7 @@ use App\Models\BaseModel; use App\Models\Wiki\Artist; use App\Models\Wiki\Song; use Database\Factories\Wiki\Song\PerformanceFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -38,6 +39,7 @@ use Spatie\EloquentSortable\SortableTrait; * * @method static PerformanceFactory factory(...$parameters) */ +#[Table(Performance::TABLE, Performance::ATTRIBUTE_ID)] class Performance extends BaseModel implements Auditable, SoftDeletable, Sortable { use HasAudits; @@ -63,20 +65,6 @@ class Performance extends BaseModel implements Auditable, SoftDeletable, Sortabl final public const string RELATION_MEMBER = 'artist.member'; final public const string RELATION_SONG = 'song'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Performance::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Performance::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -111,6 +99,23 @@ class Performance extends BaseModel implements Auditable, SoftDeletable, Sortabl 'sort_when_creating' => false, ]; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + Performance::ATTRIBUTE_ALIAS => 'string', + Performance::ATTRIBUTE_ARTIST_TYPE => 'string', + Performance::ATTRIBUTE_ARTIST_ID => 'int', + Performance::ATTRIBUTE_AS => 'string', + Performance::ATTRIBUTE_RELEVANCE => 'int', + Performance::ATTRIBUTE_SONG => 'int', + ]; + } + public function getName(): string { return strval($this->getKey()); diff --git a/app/Models/Wiki/Studio.php b/app/Models/Wiki/Studio.php index 08b1559dd..528a39149 100644 --- a/app/Models/Wiki/Studio.php +++ b/app/Models/Wiki/Studio.php @@ -20,6 +20,7 @@ use App\Pivots\Morph\Resourceable; use App\Pivots\Wiki\AnimeStudio; use Database\Factories\Wiki\StudioFactory; use Elastic\ScoutDriverPlus\Searchable; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\MorphToMany; @@ -36,6 +37,7 @@ use OwenIt\Auditing\Contracts\Auditable; * * @method static StudioFactory factory(...$parameters) */ +#[Table(Studio::TABLE, Studio::ATTRIBUTE_ID)] class Studio extends BaseModel implements Auditable, HasImages, HasResources, SoftDeletable { use HasAudits; @@ -54,20 +56,6 @@ class Studio extends BaseModel implements Auditable, HasImages, HasResources, So final public const string RELATION_IMAGES = 'images'; final public const string RELATION_RESOURCES = 'resources'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Studio::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Studio::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -92,6 +80,19 @@ class Studio extends BaseModel implements Auditable, HasImages, HasResources, So Studio::ATTRIBUTE_SLUG, ]; + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + Studio::ATTRIBUTE_NAME => 'string', + Studio::ATTRIBUTE_SLUG => 'string', + ]; + } + /** * Get the route key for the model. * diff --git a/app/Models/Wiki/Synonym.php b/app/Models/Wiki/Synonym.php index c4baae211..ac7202408 100644 --- a/app/Models/Wiki/Synonym.php +++ b/app/Models/Wiki/Synonym.php @@ -17,6 +17,7 @@ use App\Events\Wiki\Synonym\SynonymUpdated; use App\Models\BaseModel; use Database\Factories\Wiki\SynonymFactory; use Elastic\ScoutDriverPlus\Searchable; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\MorphTo; @@ -33,6 +34,7 @@ use OwenIt\Auditing\Contracts\Auditable; * * @method static SynonymFactory factory(...$parameters) */ +#[Table(Synonym::TABLE, Synonym::ATTRIBUTE_ID)] class Synonym extends BaseModel implements Auditable, SoftDeletable { use HasAudits; @@ -51,20 +53,6 @@ class Synonym extends BaseModel implements Auditable, SoftDeletable final public const string RELATION_SYNONYMABLE = 'synonymable'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Synonym::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Synonym::ATTRIBUTE_ID; - /** * The attributes that are mass assignable. * @@ -99,6 +87,9 @@ class Synonym extends BaseModel implements Auditable, SoftDeletable protected function casts(): array { return [ + Synonym::ATTRIBUTE_SYNONYMABLE_TYPE => 'string', + Synonym::ATTRIBUTE_SYNONYMABLE_ID => 'int', + Synonym::ATTRIBUTE_TEXT => 'string', Synonym::ATTRIBUTE_TYPE => SynonymType::class, ]; } diff --git a/app/Models/Wiki/Video.php b/app/Models/Wiki/Video.php index a56f1a35c..2dea5bae9 100644 --- a/app/Models/Wiki/Video.php +++ b/app/Models/Wiki/Video.php @@ -25,6 +25,8 @@ use App\Models\Wiki\Video\VideoScript; use App\Pivots\Wiki\AnimeThemeEntryVideo; use Database\Factories\Wiki\VideoFactory; use Elastic\ScoutDriverPlus\Searchable; +use Illuminate\Database\Eloquent\Attributes\Appends; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Factories\HasFactory; @@ -61,6 +63,12 @@ use OwenIt\Auditing\Contracts\Auditable; * * @method static VideoFactory factory(...$parameters) */ +#[Appends([ + Video::ATTRIBUTE_LINK, + Video::ATTRIBUTE_PRIORITY, + Video::ATTRIBUTE_TAGS, +])] +#[Table(Video::TABLE, Video::ATTRIBUTE_ID)] class Video extends BaseModel implements Auditable, SoftDeletable, Streamable { use HasAudits; @@ -99,20 +107,6 @@ class Video extends BaseModel implements Auditable, SoftDeletable, Streamable final public const string RELATION_SONG = 'animethemeentries.animetheme.song'; final public const string RELATION_TRACKS = 'tracks'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Video::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = Video::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -149,17 +143,6 @@ class Video extends BaseModel implements Auditable, SoftDeletable, Streamable Video::ATTRIBUTE_UNCEN, ]; - /** - * The accessors to append to the model's array form. - * - * @var list - */ - protected $appends = [ - Video::ATTRIBUTE_LINK, - Video::ATTRIBUTE_PRIORITY, - Video::ATTRIBUTE_TAGS, - ]; - /** * Get the attributes that should be cast. * @@ -168,9 +151,15 @@ class Video extends BaseModel implements Auditable, SoftDeletable, Streamable protected function casts(): array { return [ + Video::ATTRIBUTE_AUDIO => 'int', + Video::ATTRIBUTE_BASENAME => 'string', + Video::ATTRIBUTE_FILENAME => 'string', Video::ATTRIBUTE_LYRICS => 'boolean', + Video::ATTRIBUTE_MIMETYPE => 'string', Video::ATTRIBUTE_NC => 'boolean', Video::ATTRIBUTE_OVERLAP => VideoOverlap::class, + Video::ATTRIBUTE_PATH => 'string', + Video::ATTRIBUTE_RESOLUTION => 'int', Video::ATTRIBUTE_SIZE => 'int', Video::ATTRIBUTE_SOURCE => VideoSource::class, Video::ATTRIBUTE_SUBBED => 'boolean', diff --git a/app/Models/Wiki/Video/VideoScript.php b/app/Models/Wiki/Video/VideoScript.php index 412bb519f..2586ba886 100644 --- a/app/Models/Wiki/Video/VideoScript.php +++ b/app/Models/Wiki/Video/VideoScript.php @@ -16,6 +16,8 @@ use App\Http\Api\Schema\Wiki\Video\ScriptSchema; use App\Models\BaseModel; use App\Models\Wiki\Video; use Database\Factories\Wiki\Video\VideoScriptFactory; +use Illuminate\Database\Eloquent\Attributes\Appends; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -31,6 +33,8 @@ use OwenIt\Auditing\Contracts\Auditable; * * @method static VideoScriptFactory factory(...$parameters) */ +#[Appends([VideoScript::ATTRIBUTE_LINK])] +#[Table(VideoScript::TABLE, VideoScript::ATTRIBUTE_ID)] class VideoScript extends BaseModel implements Auditable, InteractsWithSchema, SoftDeletable { use HasAudits; @@ -46,20 +50,6 @@ class VideoScript extends BaseModel implements Auditable, InteractsWithSchema, S final public const string RELATION_VIDEO = 'video'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = VideoScript::TABLE; - - /** - * The primary key associated with the table. - * - * @var string - */ - protected $primaryKey = VideoScript::ATTRIBUTE_ID; - /** * The event map for the model. * @@ -86,13 +76,17 @@ class VideoScript extends BaseModel implements Auditable, InteractsWithSchema, S ]; /** - * The accessors to append to the model's array form. + * Get the attributes that should be cast. * - * @var list + * @return array */ - protected $appends = [ - VideoScript::ATTRIBUTE_LINK, - ]; + protected function casts(): array + { + return [ + VideoScript::ATTRIBUTE_PATH => 'string', + VideoScript::ATTRIBUTE_VIDEO => 'int', + ]; + } protected function link(): Attribute { diff --git a/app/Pivots/Document/PageRole.php b/app/Pivots/Document/PageRole.php index a9361c84f..61f0f5411 100644 --- a/app/Pivots/Document/PageRole.php +++ b/app/Pivots/Document/PageRole.php @@ -9,6 +9,7 @@ use App\Models\Auth\Role; use App\Models\Document\Page; use App\Pivots\BasePivot; use Database\Factories\Pivots\Document\PageRoleFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Relations\BelongsTo; /** @@ -21,6 +22,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; * * @method static PageRoleFactory factory(...$parameters) */ +#[Table(PageRole::TABLE)] class PageRole extends BasePivot { final public const string TABLE = 'page_roles'; @@ -33,13 +35,6 @@ class PageRole extends BasePivot final public const string RELATION_PAGE = 'page'; final public const string RELATION_ROLE = 'role'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = PageRole::TABLE; - /** * The attributes that are mass assignable. * @@ -71,6 +66,8 @@ class PageRole extends BasePivot protected function casts(): array { return [ + PageRole::ATTRIBUTE_PAGE => 'int', + PageRole::ATTRIBUTE_ROLE => 'int', PageRole::ATTRIBUTE_TYPE => PageRoleType::class, ]; } diff --git a/app/Pivots/Morph/Imageable.php b/app/Pivots/Morph/Imageable.php index 2c4e260df..ee262cc79 100644 --- a/app/Pivots/Morph/Imageable.php +++ b/app/Pivots/Morph/Imageable.php @@ -16,6 +16,7 @@ use App\Models\Wiki\Image; use App\Models\Wiki\Studio; use App\Pivots\BaseMorphPivot; use Database\Factories\Pivots\Morph\ImageableFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphTo; @@ -30,6 +31,7 @@ use Illuminate\Database\Eloquent\Relations\MorphTo; * * @method static ImageableFactory factory(...$parameters) */ +#[Table(Imageable::TABLE)] class Imageable extends BaseMorphPivot { final public const string TABLE = 'imageables'; @@ -42,13 +44,6 @@ class Imageable extends BaseMorphPivot final public const string RELATION_IMAGE = 'image'; final public const string RELATION_IMAGEABLE = 'imageable'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Imageable::TABLE; - /** * The models that have images. * @@ -95,6 +90,9 @@ class Imageable extends BaseMorphPivot { return [ Imageable::ATTRIBUTE_DEPTH => 'int', + Imageable::ATTRIBUTE_IMAGE => 'int', + Imageable::ATTRIBUTE_IMAGEABLE_TYPE => 'string', + Imageable::ATTRIBUTE_IMAGEABLE_ID => 'int', ]; } diff --git a/app/Pivots/Morph/Resourceable.php b/app/Pivots/Morph/Resourceable.php index e611b2048..21d8057de 100644 --- a/app/Pivots/Morph/Resourceable.php +++ b/app/Pivots/Morph/Resourceable.php @@ -17,6 +17,7 @@ use App\Models\Wiki\Song; use App\Models\Wiki\Studio; use App\Pivots\BaseMorphPivot; use Database\Factories\Pivots\Morph\ResourceableFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphTo; @@ -31,6 +32,7 @@ use Illuminate\Database\Eloquent\Relations\MorphTo; * * @method static ResourceableFactory factory(...$parameters) */ +#[Table(Resourceable::TABLE)] class Resourceable extends BaseMorphPivot { final public const string TABLE = 'resourceables'; @@ -43,13 +45,6 @@ class Resourceable extends BaseMorphPivot final public const string RELATION_RESOURCE = 'resource'; final public const string RELATION_RESOURCEABLE = 'resourceable'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = Resourceable::TABLE; - /** * The models that have resources. * @@ -102,6 +97,21 @@ class Resourceable extends BaseMorphPivot ]; } + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + Resourceable::ATTRIBUTE_AS => 'string', + Resourceable::ATTRIBUTE_RESOURCE => 'int', + Resourceable::ATTRIBUTE_RESOURCEABLE_TYPE => 'string', + Resourceable::ATTRIBUTE_RESOURCEABLE_ID => 'int', + ]; + } + /** * Gets the resource that owns the resourceable. * diff --git a/app/Pivots/Wiki/AnimeSeries.php b/app/Pivots/Wiki/AnimeSeries.php index 78a454431..97fb704f0 100644 --- a/app/Pivots/Wiki/AnimeSeries.php +++ b/app/Pivots/Wiki/AnimeSeries.php @@ -10,6 +10,7 @@ use App\Models\Wiki\Anime; use App\Models\Wiki\Series; use App\Pivots\BasePivot; use Database\Factories\Pivots\Wiki\AnimeSeriesFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Relations\BelongsTo; /** @@ -20,6 +21,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; * * @method static AnimeSeriesFactory factory(...$parameters) */ +#[Table(AnimeSeries::TABLE)] class AnimeSeries extends BasePivot { final public const string TABLE = 'anime_series'; @@ -30,13 +32,6 @@ class AnimeSeries extends BasePivot final public const string RELATION_ANIME = 'anime'; final public const string RELATION_SERIES = 'series'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = AnimeSeries::TABLE; - /** * The event map for the model. * @@ -72,6 +67,19 @@ class AnimeSeries extends BasePivot ]; } + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + AnimeSeries::ATTRIBUTE_ANIME => 'int', + AnimeSeries::ATTRIBUTE_SERIES => 'int', + ]; + } + /** * Gets the anime that owns the anime series. * diff --git a/app/Pivots/Wiki/AnimeStudio.php b/app/Pivots/Wiki/AnimeStudio.php index 7967ef578..aa02855c4 100644 --- a/app/Pivots/Wiki/AnimeStudio.php +++ b/app/Pivots/Wiki/AnimeStudio.php @@ -10,6 +10,7 @@ use App\Models\Wiki\Anime; use App\Models\Wiki\Studio; use App\Pivots\BasePivot; use Database\Factories\Pivots\Wiki\AnimeStudioFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Relations\BelongsTo; /** @@ -20,6 +21,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; * * @method static AnimeStudioFactory factory(...$parameters) */ +#[Table(AnimeStudio::TABLE)] class AnimeStudio extends BasePivot { final public const string TABLE = 'anime_studio'; @@ -30,13 +32,6 @@ class AnimeStudio extends BasePivot final public const string RELATION_ANIME = 'anime'; final public const string RELATION_STUDIO = 'studio'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = AnimeStudio::TABLE; - /** * The event map for the model. * @@ -72,6 +67,19 @@ class AnimeStudio extends BasePivot ]; } + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + AnimeStudio::ATTRIBUTE_ANIME => 'int', + AnimeStudio::ATTRIBUTE_STUDIO => 'int', + ]; + } + /** * Gets the anime that owns the anime studio. * diff --git a/app/Pivots/Wiki/AnimeThemeEntryVideo.php b/app/Pivots/Wiki/AnimeThemeEntryVideo.php index e86ab1a0e..0edba1628 100644 --- a/app/Pivots/Wiki/AnimeThemeEntryVideo.php +++ b/app/Pivots/Wiki/AnimeThemeEntryVideo.php @@ -10,6 +10,7 @@ use App\Models\Wiki\Anime\Theme\AnimeThemeEntry; use App\Models\Wiki\Video; use App\Pivots\BasePivot; use Database\Factories\Pivots\Wiki\AnimeThemeEntryVideoFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Relations\BelongsTo; /** @@ -20,6 +21,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; * * @method static AnimeThemeEntryVideoFactory factory(...$parameters) */ +#[Table(AnimeThemeEntryVideo::TABLE)] class AnimeThemeEntryVideo extends BasePivot { final public const string TABLE = 'anime_theme_entry_video'; @@ -34,13 +36,6 @@ class AnimeThemeEntryVideo extends BasePivot final public const string RELATION_SONG = 'animethemeentry.animetheme.song'; final public const string RELATION_VIDEO = 'video'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = AnimeThemeEntryVideo::TABLE; - /** * The event map for the model. * @@ -76,6 +71,19 @@ class AnimeThemeEntryVideo extends BasePivot ]; } + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + AnimeThemeEntryVideo::ATTRIBUTE_ENTRY => 'int', + AnimeThemeEntryVideo::ATTRIBUTE_VIDEO => 'int', + ]; + } + /** * Gets the video that owns the video entry. * diff --git a/app/Pivots/Wiki/ArtistMember.php b/app/Pivots/Wiki/ArtistMember.php index 23272e72b..a3e65557c 100644 --- a/app/Pivots/Wiki/ArtistMember.php +++ b/app/Pivots/Wiki/ArtistMember.php @@ -10,6 +10,7 @@ use App\Events\Pivot\Wiki\ArtistMember\ArtistMemberUpdated; use App\Models\Wiki\Artist; use App\Pivots\BasePivot; use Database\Factories\Pivots\Wiki\ArtistMemberFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Relations\BelongsTo; /** @@ -24,6 +25,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; * * @method static ArtistMemberFactory factory(...$parameters) */ +#[Table(ArtistMember::TABLE)] class ArtistMember extends BasePivot { final public const string TABLE = 'artist_member'; @@ -38,13 +40,6 @@ class ArtistMember extends BasePivot final public const string RELATION_ARTIST = 'artist'; final public const string RELATION_MEMBER = 'member'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = ArtistMember::TABLE; - /** * The event map for the model. * @@ -85,6 +80,23 @@ class ArtistMember extends BasePivot ]; } + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + ArtistMember::ATTRIBUTE_ALIAS => 'string', + ArtistMember::ATTRIBUTE_ARTIST => 'int', + ArtistMember::ATTRIBUTE_AS => 'string', + ArtistMember::ATTRIBUTE_MEMBER => 'int', + ArtistMember::ATTRIBUTE_NOTES => 'string', + ArtistMember::ATTRIBUTE_RELEVANCE => 'int', + ]; + } + /** * Gets the artist that owns the artist member. * diff --git a/app/Pivots/Wiki/ArtistSong.php b/app/Pivots/Wiki/ArtistSong.php index 58ade8a36..31671d23f 100644 --- a/app/Pivots/Wiki/ArtistSong.php +++ b/app/Pivots/Wiki/ArtistSong.php @@ -8,6 +8,7 @@ use App\Models\Wiki\Artist; use App\Models\Wiki\Song; use App\Pivots\BasePivot; use Database\Factories\Pivots\Wiki\ArtistSongFactory; +use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Relations\BelongsTo; /** @@ -20,6 +21,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; * * @method static ArtistSongFactory factory(...$parameters) */ +#[Table(ArtistSong::TABLE)] class ArtistSong extends BasePivot { final public const string TABLE = 'artist_song'; @@ -32,13 +34,6 @@ class ArtistSong extends BasePivot final public const string RELATION_ARTIST = 'artist'; final public const string RELATION_SONG = 'song'; - /** - * The table associated with the model. - * - * @var string - */ - protected $table = ArtistSong::TABLE; - /** * The attributes that are mass assignable. * @@ -64,6 +59,21 @@ class ArtistSong extends BasePivot ]; } + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + ArtistSong::ATTRIBUTE_ALIAS => 'string', + ArtistSong::ATTRIBUTE_ARTIST => 'int', + ArtistSong::ATTRIBUTE_AS => 'string', + ArtistSong::ATTRIBUTE_SONG => 'int', + ]; + } + /** * Gets the artist that owns the artist song. * diff --git a/app/Providers/Filament/SubmissionPanelProvider.php b/app/Providers/Filament/SubmissionPanelProvider.php index a160edf1a..01939812a 100644 --- a/app/Providers/Filament/SubmissionPanelProvider.php +++ b/app/Providers/Filament/SubmissionPanelProvider.php @@ -14,7 +14,7 @@ use Filament\Support\Colors\Color; use Filament\Support\Enums\Width; use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse; use Illuminate\Cookie\Middleware\EncryptCookies; -use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken; +use Illuminate\Foundation\Http\Middleware\PreventRequestForgery; use Illuminate\Routing\Middleware\SubstituteBindings; use Illuminate\Session\Middleware\StartSession; use Illuminate\Support\Facades\Config; @@ -43,7 +43,7 @@ class SubmissionPanelProvider extends PanelProvider StartSession::class, AuthenticateSession::class, ShareErrorsFromSession::class, - VerifyCsrfToken::class, + PreventRequestForgery::class, SubstituteBindings::class, DisableBladeIconComponents::class, DispatchServingFilamentEvent::class, diff --git a/app/Providers/FilamentPanelProvider.php b/app/Providers/FilamentPanelProvider.php index 009a7cd89..b409e834e 100644 --- a/app/Providers/FilamentPanelProvider.php +++ b/app/Providers/FilamentPanelProvider.php @@ -26,7 +26,7 @@ use Filament\Tables\Table; use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse; use Illuminate\Cookie\Middleware\EncryptCookies; use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull; -use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken; +use Illuminate\Foundation\Http\Middleware\PreventRequestForgery; use Illuminate\Routing\Middleware\SubstituteBindings; use Illuminate\Session\Middleware\AuthenticateSession; use Illuminate\Session\Middleware\StartSession; @@ -111,7 +111,7 @@ class FilamentPanelProvider extends PanelProvider StartSession::class, AuthenticateSession::class, ShareErrorsFromSession::class, - VerifyCsrfToken::class, + PreventRequestForgery::class, SubstituteBindings::class, DisableBladeIconComponents::class, DispatchServingFilamentEvent::class, diff --git a/app/Providers/GraphQLServiceProvider.php b/app/Providers/GraphQLServiceProvider.php index d5584113f..ae5d1daf8 100644 --- a/app/Providers/GraphQLServiceProvider.php +++ b/app/Providers/GraphQLServiceProvider.php @@ -7,7 +7,7 @@ namespace App\Providers; use App\Enums\GraphQL\Filter\ComparisonOperator; use App\Enums\GraphQL\Filter\TrashedFilter; use App\Enums\GraphQL\Sort\SortDirection; -use App\Enums\Models\List\ExternalEntryWatchStatus; +use App\Enums\Models\List\ExternalEntryStatus; use App\Enums\Models\List\ExternalProfileSite; use App\Enums\Models\List\ExternalProfileVisibility; use App\Enums\Models\List\PlaylistVisibility; @@ -50,7 +50,7 @@ class GraphQLServiceProvider extends ServiceProvider GraphQL::addType(new EnumType(ComparisonOperator::class)); GraphQL::addType(new EnumType(TrashedFilter::class)); GraphQL::addType(new EnumType(SortDirection::class)); - GraphQL::addType(new EnumType(ExternalEntryWatchStatus::class)); + GraphQL::addType(new EnumType(ExternalEntryStatus::class)); GraphQL::addType(new EnumType(ExternalProfileSite::class)); GraphQL::addType(new EnumType(ExternalProfileVisibility::class)); GraphQL::addType(new EnumType(PlaylistVisibility::class)); diff --git a/app/Scopes/WithoutInsertSongScope.php b/app/Scopes/WithoutInsertSongScope.php index 3e0215689..526d67d48 100644 --- a/app/Scopes/WithoutInsertSongScope.php +++ b/app/Scopes/WithoutInsertSongScope.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace App\Scopes; use App\Enums\Models\Wiki\ThemeType; +use App\Http\Middleware\Api\SetServingJsonApi; use App\Models\Wiki\Anime\AnimeTheme; use Filament\Facades\Filament; use Illuminate\Database\Eloquent\Builder; @@ -18,7 +19,7 @@ class WithoutInsertSongScope implements Scope */ public function apply(Builder $builder, Model $model): void { - if (Filament::isServing()) { + if (Filament::isServing() || ! SetServingJsonApi::$isServing) { return; } diff --git a/app/Services/FlowframeTrend/Adapters/AbstractAdapter.php b/app/Services/FlowframeTrend/Adapters/AbstractAdapter.php new file mode 100644 index 000000000..4540d7c58 --- /dev/null +++ b/app/Services/FlowframeTrend/Adapters/AbstractAdapter.php @@ -0,0 +1,10 @@ + '%Y-%m-%d %H:%i:00', + 'hour' => '%Y-%m-%d %H:00', + 'day' => '%Y-%m-%d', + 'week' => '%Y-%u', + 'month' => '%Y-%m', + 'year' => '%Y', + default => throw new Error('Invalid interval.'), + }; + + return "date_format({$column}, '{$format}')"; + } +} diff --git a/app/Services/FlowframeTrend/Adapters/PgsqlAdapter.php b/app/Services/FlowframeTrend/Adapters/PgsqlAdapter.php new file mode 100644 index 000000000..5ff1151ae --- /dev/null +++ b/app/Services/FlowframeTrend/Adapters/PgsqlAdapter.php @@ -0,0 +1,25 @@ + 'YYYY-MM-DD HH24:MI:00', + 'hour' => 'YYYY-MM-DD HH24:00:00', + 'day' => 'YYYY-MM-DD', + 'week' => 'IYYY-IW', + 'month' => 'YYYY-MM', + 'year' => 'YYYY', + default => throw new Error('Invalid interval.'), + }; + + return "to_char(\"{$column}\", '{$format}')"; + } +} diff --git a/app/Services/FlowframeTrend/Adapters/SqliteAdapter.php b/app/Services/FlowframeTrend/Adapters/SqliteAdapter.php new file mode 100644 index 000000000..4a5188b3e --- /dev/null +++ b/app/Services/FlowframeTrend/Adapters/SqliteAdapter.php @@ -0,0 +1,25 @@ + '%Y-%m-%d %H:%M:00', + 'hour' => '%Y-%m-%d %H:00', + 'day' => '%Y-%m-%d', + 'week' => '%Y-%W', + 'month' => '%Y-%m', + 'year' => '%Y', + default => throw new Error('Invalid interval.'), + }; + + return "strftime('{$format}', {$column})"; + } +} diff --git a/app/Services/FlowframeTrend/Trend.php b/app/Services/FlowframeTrend/Trend.php new file mode 100644 index 000000000..546b59297 --- /dev/null +++ b/app/Services/FlowframeTrend/Trend.php @@ -0,0 +1,196 @@ +start = $start; + $this->end = $end; + + return $this; + } + + public function interval(string $interval): self + { + $this->interval = $interval; + + return $this; + } + + public function perMinute(): self + { + return $this->interval('minute'); + } + + public function perHour(): self + { + return $this->interval('hour'); + } + + public function perDay(): self + { + return $this->interval('day'); + } + + public function perWeek(): self + { + return $this->interval('week'); + } + + public function perMonth(): self + { + return $this->interval('month'); + } + + public function perYear(): self + { + return $this->interval('year'); + } + + public function dateColumn(string $column): self + { + $this->dateColumn = $column; + + return $this; + } + + public function dateAlias(string $alias): self + { + $this->dateAlias = $alias; + + return $this; + } + + public function aggregate(string $column, string $aggregate): Collection + { + $values = $this->builder + ->toBase() + ->selectRaw(" + {$this->getSqlDate()} as {$this->dateAlias}, + {$aggregate}({$column}) as aggregate + ") + ->whereBetween($this->dateColumn, [$this->start, $this->end]) + ->groupBy($this->dateAlias) + ->orderBy($this->dateAlias) + ->get(); + + return $this->mapValuesToDates($values); + } + + public function average(string $column): Collection + { + return $this->aggregate($column, 'avg'); + } + + public function min(string $column): Collection + { + return $this->aggregate($column, 'min'); + } + + public function max(string $column): Collection + { + return $this->aggregate($column, 'max'); + } + + public function sum(string $column): Collection + { + return $this->aggregate($column, 'sum'); + } + + public function count(string $column = '*'): Collection + { + return $this->aggregate($column, 'count'); + } + + public function mapValuesToDates(Collection $values): Collection + { + $values = $values->map(fn ($value): TrendValue => new TrendValue( + date: $value->{$this->dateAlias}, + aggregate: $value->aggregate, + )); + + $placeholders = $this->getDatePeriod()->map( + fn (CarbonInterface $date): TrendValue => new TrendValue( + date: $date->format($this->getCarbonDateFormat()), + aggregate: 0, + ) + ); + + return $values + ->merge($placeholders) + ->unique('date') + ->sort() + ->flatten(); + } + + protected function getDatePeriod(): Collection + { + return collect( + CarbonPeriod::between( + $this->start, + $this->end, + )->interval("1 {$this->interval}") + ); + } + + protected function getSqlDate(): string + { + // @phpstan-ignore-next-line + $adapter = match ($this->builder->getConnection()->getDriverName()) { + 'mysql', 'mariadb' => new MySqlAdapter(), + 'sqlite' => new SqliteAdapter(), + 'pgsql' => new PgsqlAdapter(), + default => throw new Error('Unsupported database driver.'), + }; + + return $adapter->format($this->dateColumn, $this->interval); + } + + protected function getCarbonDateFormat(): string + { + return match ($this->interval) { + 'minute' => 'Y-m-d H:i:00', + 'hour' => 'Y-m-d H:00', + 'day' => 'Y-m-d', + 'week' => 'Y-W', + 'month' => 'Y-m', + 'year' => 'Y', + default => throw new Error('Invalid interval.'), + }; + } +} diff --git a/app/Services/FlowframeTrend/TrendValue.php b/app/Services/FlowframeTrend/TrendValue.php new file mode 100644 index 000000000..33206fda8 --- /dev/null +++ b/app/Services/FlowframeTrend/TrendValue.php @@ -0,0 +1,13 @@ +=2", "elemind/filament-echarts": "^1.1", "fakerphp/faker": "^1.24.1", "filament/filament": "^5.4.1", - "flowframe/laravel-trend": ">=0.4", "guzzlehttp/guzzle": "^7.10.0", "kyrch/laravel-prohibitions": "^1.2.0", "larastan/larastan": "^3.9.3", "laravel-notification-channels/discord": "^1.8", "laravel/fortify": "^1.36.1", - "laravel/framework": "^12.55.1", + "laravel/framework": "^13.1.1", "laravel/horizon": "^5.45.4", "laravel/pennant": "^1.22.0", "laravel/pulse": "^1.7.2", @@ -55,12 +55,12 @@ "spatie/db-dumper": "^3.8.3", "spatie/eloquent-sortable": "^5.0.1", "spatie/laravel-permission": "^6.25.0", - "staudenmeir/belongs-to-through": "^2.17", - "staudenmeir/eloquent-has-many-deep": "1.21.1", - "staudenmeir/laravel-adjacency-list": "^1.25.2", + "staudenmeir/belongs-to-through": "^2.18", + "staudenmeir/eloquent-has-many-deep": "^1.22.1", + "staudenmeir/laravel-adjacency-list": "^1.26.0", "symfony/http-client": "^6.4.34", "symfony/mailgun-mailer": "^6.4.24", - "vinkla/hashids": "^13.0" + "vinkla/hashids": "^14.0" }, "require-dev": { "driftingly/rector-laravel": "^2.2.0", @@ -69,10 +69,11 @@ "laravel/sail": "^1.54.0", "mockery/mockery": "^1.6.12", "mrpunyapal/rector-pest": "^0.2.3", - "pestphp/pest": "^4.4.2", + "pestphp/pest": "^4.4.3", "pestphp/pest-plugin-laravel": "^4.1", "predis/predis": "^2.4.1", - "rector/rector": "^2.3.9" + "rector/rector": "^2.3.9", + "symplify/vendor-patches": ">=12.0.6" }, "config": { "optimize-autoloader": true, @@ -83,11 +84,20 @@ "preferred-install": "dist", "sort-packages": true, "allow-plugins": { + "cweagans/composer-patches": true, "pestphp/pest-plugin": true, "php-http/discovery": true } }, "extra": { + "patches": { + "babenkoivan/elastic-scout-driver": [ + "patches/babenkoivan-elastic-scout-driver-src-serviceprovider-php.patch" + ], + "babenkoivan/elastic-scout-driver-plus": [ + "patches/babenkoivan-elastic-scout-driver-plus-src-serviceprovider-php.patch" + ] + }, "laravel": { "dont-discover": [] } diff --git a/composer.lock b/composer.lock index e0c3a440b..3a26c57c8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "69697d9f1021893da029840fe1ef03fa", + "content-hash": "2fbfea7c0fad2494b99a8fc5299d666f", "packages": [ { "name": "ajcastro/eager-load-pivot-relations", @@ -1221,6 +1221,129 @@ ], "time": "2026-03-20T21:10:52+00:00" }, + { + "name": "cweagans/composer-configurable-plugin", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/cweagans/composer-configurable-plugin.git", + "reference": "15433906511a108a1806710e988629fd24b89974" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweagans/composer-configurable-plugin/zipball/15433906511a108a1806710e988629fd24b89974", + "reference": "15433906511a108a1806710e988629fd24b89974", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "require-dev": { + "codeception/codeception": "~4.0", + "codeception/module-asserts": "^2.0", + "composer/composer": "~2.0", + "php-coveralls/php-coveralls": "~2.0", + "php-parallel-lint/php-parallel-lint": "^1.0.0", + "phpro/grumphp": "^1.8.0", + "sebastian/phpcpd": "^6.0", + "squizlabs/php_codesniffer": "^3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "cweagans\\Composer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Cameron Eagans", + "email": "me@cweagans.net" + } + ], + "description": "Provides a lightweight configuration system for Composer plugins.", + "support": { + "issues": "https://github.com/cweagans/composer-configurable-plugin/issues", + "source": "https://github.com/cweagans/composer-configurable-plugin/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/cweagans", + "type": "github" + } + ], + "time": "2023-02-12T04:58:58+00:00" + }, + { + "name": "cweagans/composer-patches", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/cweagans/composer-patches.git", + "reference": "bfa6018a5f864653d9ed899b902ea72f858a2cf7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/bfa6018a5f864653d9ed899b902ea72f858a2cf7", + "reference": "bfa6018a5f864653d9ed899b902ea72f858a2cf7", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "cweagans/composer-configurable-plugin": "^2.0", + "ext-json": "*", + "php": ">=8.0.0" + }, + "require-dev": { + "codeception/codeception": "~4.0", + "codeception/module-asserts": "^2.0", + "codeception/module-cli": "^2.0", + "codeception/module-filesystem": "^2.0", + "composer/composer": "~2.0", + "php-coveralls/php-coveralls": "~2.0", + "php-parallel-lint/php-parallel-lint": "^1.0.0", + "phpro/grumphp": "^1.8.0", + "sebastian/phpcpd": "^6.0", + "squizlabs/php_codesniffer": "^4.0" + }, + "type": "composer-plugin", + "extra": { + "_": "The following two lines ensure that composer-patches is loaded as early as possible.", + "class": "cweagans\\Composer\\Plugin\\Patches", + "plugin-modifies-downloads": true, + "plugin-modifies-install-path": true + }, + "autoload": { + "psr-4": { + "cweagans\\Composer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Cameron Eagans", + "email": "me@cweagans.net" + } + ], + "description": "Provides a way to patch Composer packages.", + "support": { + "issues": "https://github.com/cweagans/composer-patches/issues", + "source": "https://github.com/cweagans/composer-patches/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/cweagans", + "type": "github" + } + ], + "time": "2025-10-30T23:44:22+00:00" + }, { "name": "danharrin/date-format-converter", "version": "v0.3.1", @@ -2546,80 +2669,6 @@ }, "time": "2026-03-17T20:05:33+00:00" }, - { - "name": "flowframe/laravel-trend", - "version": "v0.4.0", - "source": { - "type": "git", - "url": "https://github.com/Flowframe/laravel-trend.git", - "reference": "5ace11d3075932652dc48963faa732c043aeb14d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Flowframe/laravel-trend/zipball/5ace11d3075932652dc48963faa732c043aeb14d", - "reference": "5ace11d3075932652dc48963faa732c043aeb14d", - "shasum": "" - }, - "require": { - "illuminate/contracts": "^8.37|^9|^10.0|^11.0|^12.0", - "php": "^8.2", - "spatie/laravel-package-tools": "^1.4.3" - }, - "require-dev": { - "nunomaduro/collision": "^5.3|^6.1|^8.0", - "orchestra/testbench": "^6.15|^7.0|^8.0|^9.0|^10.0", - "pestphp/pest": "^1.18|^2.34|^3.7", - "pestphp/pest-plugin-laravel": "^1.1|^2.3|^3.1", - "spatie/laravel-ray": "^1.23", - "vimeo/psalm": "^4.8|^5.6|^6.5" - }, - "type": "library", - "extra": { - "laravel": { - "aliases": { - "Trend": "Flowframe\\Trend\\TrendFacade" - }, - "providers": [ - "Flowframe\\Trend\\TrendServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Flowframe\\Trend\\": "src", - "Flowframe\\Trend\\Database\\Factories\\": "database/factories" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Lars Klopstra", - "email": "lars@flowframe.nl", - "role": "Developer" - } - ], - "description": "Easily generate model trends", - "homepage": "https://github.com/flowframe/laravel-trend", - "keywords": [ - "Flowframe", - "laravel", - "laravel-trend" - ], - "support": { - "issues": "https://github.com/Flowframe/laravel-trend/issues", - "source": "https://github.com/Flowframe/laravel-trend/tree/v0.4.0" - }, - "funding": [ - { - "url": "https://github.com/larsklopstra", - "type": "github" - } - ], - "time": "2025-02-25T11:13:23+00:00" - }, { "name": "fruitcake/php-cors", "version": "v1.4.0", @@ -3769,24 +3818,24 @@ }, { "name": "laravel/framework", - "version": "v12.55.1", + "version": "v13.1.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "6d9185a248d101b07eecaf8fd60b18129545fd33" + "reference": "5525d87797815c55f7a89d0dfc1dd89e9de98b63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/6d9185a248d101b07eecaf8fd60b18129545fd33", - "reference": "6d9185a248d101b07eecaf8fd60b18129545fd33", + "url": "https://api.github.com/repos/laravel/framework/zipball/5525d87797815c55f7a89d0dfc1dd89e9de98b63", + "reference": "5525d87797815c55f7a89d0dfc1dd89e9de98b63", "shasum": "" }, "require": { - "brick/math": "^0.11|^0.12|^0.13|^0.14", + "brick/math": "^0.14.2 || ^0.15 || ^0.16 || ^0.17", "composer-runtime-api": "^2.2", "doctrine/inflector": "^2.0.5", "dragonmantank/cron-expression": "^3.4", - "egulias/email-validator": "^3.2.1|^4.0", + "egulias/email-validator": "^4.0", "ext-ctype": "*", "ext-filter": "*", "ext-hash": "*", @@ -3798,7 +3847,7 @@ "guzzlehttp/guzzle": "^7.8.2", "guzzlehttp/uri-template": "^1.0", "laravel/prompts": "^0.3.0", - "laravel/serializable-closure": "^1.3|^2.0", + "laravel/serializable-closure": "^2.0.10", "league/commonmark": "^2.8.1", "league/flysystem": "^3.25.1", "league/flysystem-local": "^3.25.1", @@ -3806,25 +3855,24 @@ "monolog/monolog": "^3.0", "nesbot/carbon": "^3.8.4", "nunomaduro/termwind": "^2.0", - "php": "^8.2", - "psr/container": "^1.1.1|^2.0.1", - "psr/log": "^1.0|^2.0|^3.0", - "psr/simple-cache": "^1.0|^2.0|^3.0", + "php": "^8.3", + "psr/container": "^1.1.1 || ^2.0.1", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0", "ramsey/uuid": "^4.7", - "symfony/console": "^7.2.0", - "symfony/error-handler": "^7.2.0", - "symfony/finder": "^7.2.0", - "symfony/http-foundation": "^7.2.0", - "symfony/http-kernel": "^7.2.0", - "symfony/mailer": "^7.2.0", - "symfony/mime": "^7.2.0", - "symfony/polyfill-php83": "^1.33", + "symfony/console": "^7.4.0 || ^8.0.0", + "symfony/error-handler": "^7.4.0 || ^8.0.0", + "symfony/finder": "^7.4.0 || ^8.0.0", + "symfony/http-foundation": "^7.4.0 || ^8.0.0", + "symfony/http-kernel": "^7.4.0 || ^8.0.0", + "symfony/mailer": "^7.4.0 || ^8.0.0", + "symfony/mime": "^7.4.0 || ^8.0.0", "symfony/polyfill-php84": "^1.33", "symfony/polyfill-php85": "^1.33", - "symfony/process": "^7.2.0", - "symfony/routing": "^7.2.0", - "symfony/uid": "^7.2.0", - "symfony/var-dumper": "^7.2.0", + "symfony/process": "^7.4.5 || ^8.0.5", + "symfony/routing": "^7.4.0 || ^8.0.0", + "symfony/uid": "^7.4.0 || ^8.0.0", + "symfony/var-dumper": "^7.4.0 || ^8.0.0", "tijsverkoyen/css-to-inline-styles": "^2.2.5", "vlucas/phpdotenv": "^5.6.1", "voku/portable-ascii": "^2.0.2" @@ -3833,9 +3881,9 @@ "tightenco/collect": "<5.5.33" }, "provide": { - "psr/container-implementation": "1.1|2.0", - "psr/log-implementation": "1.0|2.0|3.0", - "psr/simple-cache-implementation": "1.0|2.0|3.0" + "psr/container-implementation": "1.1 || 2.0", + "psr/log-implementation": "1.0 || 2.0 || 3.0", + "psr/simple-cache-implementation": "1.0 || 2.0 || 3.0" }, "replace": { "illuminate/auth": "self.version", @@ -3891,22 +3939,22 @@ "league/flysystem-sftp-v3": "^3.25.1", "mockery/mockery": "^1.6.10", "opis/json-schema": "^2.4.1", - "orchestra/testbench-core": "^10.9.0", - "pda/pheanstalk": "^5.0.6|^7.0.0", + "orchestra/testbench-core": "^11.0.0", + "pda/pheanstalk": "^7.0.0 || ^8.0.0", "php-http/discovery": "^1.15", - "phpstan/phpstan": "^2.1.41", - "phpunit/phpunit": "^10.5.35|^11.5.3|^12.0.1", - "predis/predis": "^2.3|^3.0", - "resend/resend-php": "^0.10.0|^1.0", - "symfony/cache": "^7.2.0", - "symfony/http-client": "^7.2.0", - "symfony/psr-http-message-bridge": "^7.2.0", - "symfony/translation": "^7.2.0" + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^11.5.50 || ^12.5.8 || ^13.0.3", + "predis/predis": "^2.3 || ^3.0", + "resend/resend-php": "^1.0", + "symfony/cache": "^7.4.0 || ^8.0.0", + "symfony/http-client": "^7.4.0 || ^8.0.0", + "symfony/psr-http-message-bridge": "^7.4.0 || ^8.0.0", + "symfony/translation": "^7.4.0 || ^8.0.0" }, "suggest": { "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.322.9).", - "brianium/paratest": "Required to run tests in parallel (^7.0|^8.0).", + "brianium/paratest": "Required to run tests in parallel (^7.0 || ^8.0).", "ext-apcu": "Required to use the APC cache driver.", "ext-fileinfo": "Required to use the Filesystem class.", "ext-ftp": "Required to use the Flysystem FTP driver.", @@ -3915,7 +3963,7 @@ "ext-pcntl": "Required to use all features of the queue worker and console signal trapping.", "ext-pdo": "Required to use all database features.", "ext-posix": "Required to use all features of the queue worker.", - "ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0|^6.0).", + "ext-redis": "Required to use the Redis cache and queue drivers (^4.0 || ^5.0 || ^6.0).", "fakerphp/faker": "Required to generate fake data using the fake() helper (^1.23).", "filp/whoops": "Required for friendly error pages in development (^2.14.3).", "laravel/tinker": "Required to use the tinker console command (^2.0).", @@ -3925,24 +3973,24 @@ "league/flysystem-read-only": "Required to use read-only disks (^3.25.1)", "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.25.1).", "mockery/mockery": "Required to use mocking (^1.6).", - "pda/pheanstalk": "Required to use the beanstalk queue driver (^5.0).", + "pda/pheanstalk": "Required to use the beanstalk queue driver (^7.0 || ^8.0).", "php-http/discovery": "Required to use PSR-7 bridging features (^1.15).", - "phpunit/phpunit": "Required to use assertions and run tests (^10.5.35|^11.5.3|^12.0.1).", - "predis/predis": "Required to use the predis connector (^2.3|^3.0).", + "phpunit/phpunit": "Required to use assertions and run tests (^11.5.50 || ^12.5.8 || ^13.0.3).", + "predis/predis": "Required to use the predis connector (^2.3 || ^3.0).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).", - "resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0|^1.0).", - "symfony/cache": "Required to PSR-6 cache bridge (^7.2).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^7.2).", - "symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.2).", - "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.2).", - "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.2).", - "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.2)." + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0 || ^7.0).", + "resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0 || ^1.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^7.4 || ^8.0).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^7.4 || ^8.0).", + "symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.4 || ^8.0).", + "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.4 || ^8.0).", + "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.4 || ^8.0).", + "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.4 || ^8.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "12.x-dev" + "dev-master": "13.0.x-dev" } }, "autoload": { @@ -3987,7 +4035,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2026-03-18T14:28:59+00:00" + "time": "2026-03-18T17:10:25+00:00" }, { "name": "laravel/horizon", @@ -7637,16 +7685,16 @@ }, { "name": "psy/psysh", - "version": "v0.12.21", + "version": "v0.12.22", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "4821fab5b7cd8c49a673a9fd5754dc9162bb9e97" + "reference": "3be75d5b9244936dd4ac62ade2bfb004d13acf0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/4821fab5b7cd8c49a673a9fd5754dc9162bb9e97", - "reference": "4821fab5b7cd8c49a673a9fd5754dc9162bb9e97", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/3be75d5b9244936dd4ac62ade2bfb004d13acf0f", + "reference": "3be75d5b9244936dd4ac62ade2bfb004d13acf0f", "shasum": "" }, "require": { @@ -7710,9 +7758,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.12.21" + "source": "https://github.com/bobthecow/psysh/tree/v0.12.22" }, - "time": "2026-03-06T21:21:28+00:00" + "time": "2026-03-22T23:03:24+00:00" }, { "name": "ralouphie/getallheaders", @@ -8572,29 +8620,29 @@ }, { "name": "staudenmeir/belongs-to-through", - "version": "v2.17", + "version": "v2.18", "source": { "type": "git", "url": "https://github.com/staudenmeir/belongs-to-through.git", - "reference": "e45460f8eecd882e5daea2af8f948d7596c20ba0" + "reference": "accb37643cf4829319617923877d11b55558a099" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/staudenmeir/belongs-to-through/zipball/e45460f8eecd882e5daea2af8f948d7596c20ba0", - "reference": "e45460f8eecd882e5daea2af8f948d7596c20ba0", + "url": "https://api.github.com/repos/staudenmeir/belongs-to-through/zipball/accb37643cf4829319617923877d11b55558a099", + "reference": "accb37643cf4829319617923877d11b55558a099", "shasum": "" }, "require": { - "illuminate/database": "^12.0", - "php": "^8.2" + "illuminate/database": "^13.0", + "php": "^8.3" }, "require-dev": { "barryvdh/laravel-ide-helper": "^3.0", "larastan/larastan": "^3.0", - "laravel/framework": "^12.0", + "laravel/framework": "^13.0", "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": "^10.0", - "phpunit/phpunit": "^11.0" + "orchestra/testbench-core": "^11.0", + "phpunit/phpunit": "^12.5" }, "type": "library", "extra": { @@ -8627,7 +8675,7 @@ "description": "Laravel Eloquent BelongsToThrough relationships", "support": { "issues": "https://github.com/staudenmeir/belongs-to-through/issues", - "source": "https://github.com/staudenmeir/belongs-to-through/tree/v2.17" + "source": "https://github.com/staudenmeir/belongs-to-through/tree/v2.18" }, "funding": [ { @@ -8635,38 +8683,37 @@ "type": "custom" } ], - "time": "2025-02-20T19:24:03+00:00" + "time": "2026-02-28T16:25:30+00:00" }, { "name": "staudenmeir/eloquent-has-many-deep", - "version": "v1.21.1", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/staudenmeir/eloquent-has-many-deep.git", - "reference": "7810607379cef2e18accc75ee09903070178255d" + "reference": "e4fe26fd2acaab05cc283bb916d813425f960947" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/staudenmeir/eloquent-has-many-deep/zipball/7810607379cef2e18accc75ee09903070178255d", - "reference": "7810607379cef2e18accc75ee09903070178255d", + "url": "https://api.github.com/repos/staudenmeir/eloquent-has-many-deep/zipball/e4fe26fd2acaab05cc283bb916d813425f960947", + "reference": "e4fe26fd2acaab05cc283bb916d813425f960947", "shasum": "" }, "require": { - "illuminate/database": "^12.0", - "php": "^8.2", - "staudenmeir/eloquent-has-many-deep-contracts": "^1.3" + "illuminate/database": "^13.0", + "php": "^8.3", + "staudenmeir/eloquent-has-many-deep-contracts": "^1.4" }, "require-dev": { - "awobaz/compoships": "^2.3", + "awobaz/compoships": "^2.5.5", "barryvdh/laravel-ide-helper": "^3.0", - "korridor/laravel-has-many-merged": "^1.2", "larastan/larastan": "^3.0", - "laravel/framework": "^12.0", + "laravel/framework": "^13.0", "mockery/mockery": "^1.6", - "orchestra/testbench-core": "^10.0", - "phpunit/phpunit": "^11.0", - "staudenmeir/eloquent-json-relations": "^1.14", - "staudenmeir/laravel-adjacency-list": "^1.24" + "orchestra/testbench-core": "^11.0", + "phpunit/phpunit": "^12.5", + "staudenmeir/eloquent-json-relations": "v1.15", + "staudenmeir/laravel-adjacency-list": "v1.26" }, "type": "library", "extra": { @@ -8694,7 +8741,7 @@ "description": "Laravel Eloquent HasManyThrough relationships with unlimited levels", "support": { "issues": "https://github.com/staudenmeir/eloquent-has-many-deep/issues", - "source": "https://github.com/staudenmeir/eloquent-has-many-deep/tree/v1.21.1" + "source": "https://github.com/staudenmeir/eloquent-has-many-deep/tree/v1.22.1" }, "funding": [ { @@ -8702,25 +8749,25 @@ "type": "custom" } ], - "time": "2025-06-29T13:53:15+00:00" + "time": "2026-03-14T10:53:06+00:00" }, { "name": "staudenmeir/eloquent-has-many-deep-contracts", - "version": "v1.3", + "version": "v1.4", "source": { "type": "git", "url": "https://github.com/staudenmeir/eloquent-has-many-deep-contracts.git", - "reference": "37ce351e4db919b3af606bc8ca0e62e2e4939cde" + "reference": "6eadbd6904c057e9439f86f8de185f56693fa537" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/staudenmeir/eloquent-has-many-deep-contracts/zipball/37ce351e4db919b3af606bc8ca0e62e2e4939cde", - "reference": "37ce351e4db919b3af606bc8ca0e62e2e4939cde", + "url": "https://api.github.com/repos/staudenmeir/eloquent-has-many-deep-contracts/zipball/6eadbd6904c057e9439f86f8de185f56693fa537", + "reference": "6eadbd6904c057e9439f86f8de185f56693fa537", "shasum": "" }, "require": { - "illuminate/database": "^12.0", - "php": "^8.2" + "illuminate/database": "^13.0", + "php": "^8.3" }, "type": "library", "autoload": { @@ -8741,39 +8788,38 @@ "description": "Contracts for staudenmeir/eloquent-has-many-deep", "support": { "issues": "https://github.com/staudenmeir/eloquent-has-many-deep-contracts/issues", - "source": "https://github.com/staudenmeir/eloquent-has-many-deep-contracts/tree/v1.3" + "source": "https://github.com/staudenmeir/eloquent-has-many-deep-contracts/tree/v1.4" }, - "time": "2025-02-15T17:11:01+00:00" + "time": "2026-02-28T21:33:50+00:00" }, { "name": "staudenmeir/laravel-adjacency-list", - "version": "v1.25.2", + "version": "v1.26", "source": { "type": "git", "url": "https://github.com/staudenmeir/laravel-adjacency-list.git", - "reference": "a54c5ff70d2d417251f33dfda5646e84d1c6d55e" + "reference": "f9fb9a8bb5958b750bca04ae4ef4207f32a1e449" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/staudenmeir/laravel-adjacency-list/zipball/a54c5ff70d2d417251f33dfda5646e84d1c6d55e", - "reference": "a54c5ff70d2d417251f33dfda5646e84d1c6d55e", + "url": "https://api.github.com/repos/staudenmeir/laravel-adjacency-list/zipball/f9fb9a8bb5958b750bca04ae4ef4207f32a1e449", + "reference": "f9fb9a8bb5958b750bca04ae4ef4207f32a1e449", "shasum": "" }, "require": { - "illuminate/database": "^12.0", - "php": "^8.2", - "staudenmeir/eloquent-has-many-deep-contracts": "^1.3", - "staudenmeir/laravel-cte": "^1.12.1" + "illuminate/database": "^13.0", + "php": "^8.3", + "staudenmeir/eloquent-has-many-deep-contracts": "^1.4", + "staudenmeir/laravel-cte": "^1.13" }, "require-dev": { "barryvdh/laravel-ide-helper": "^3.0", "larastan/larastan": "^3.0", - "laravel/framework": "^12.0", + "laravel/framework": "^13.0", "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": "^10.0", - "phpunit/phpunit": "^11.0", - "singlestoredb/singlestoredb-laravel": "^2.0", - "staudenmeir/eloquent-has-many-deep": "^1.21" + "orchestra/testbench-core": "^11.0", + "phpunit/phpunit": "^12.5", + "staudenmeir/eloquent-has-many-deep": "^1.22" }, "suggest": { "barryvdh/laravel-ide-helper": "Provide type hints for attributes and relations." @@ -8804,7 +8850,7 @@ "description": "Recursive Laravel Eloquent relationships with CTEs", "support": { "issues": "https://github.com/staudenmeir/laravel-adjacency-list/issues", - "source": "https://github.com/staudenmeir/laravel-adjacency-list/tree/v1.25.2" + "source": "https://github.com/staudenmeir/laravel-adjacency-list/tree/v1.26" }, "funding": [ { @@ -8812,33 +8858,31 @@ "type": "custom" } ], - "time": "2025-07-27T18:15:05+00:00" + "time": "2026-03-01T11:30:16+00:00" }, { "name": "staudenmeir/laravel-cte", - "version": "v1.12.4", + "version": "v1.13.0", "source": { "type": "git", "url": "https://github.com/staudenmeir/laravel-cte.git", - "reference": "48cdb4d22bbf3dc1bce3314650659f17fd0e223f" + "reference": "cf59f3b842e411cb22d7446ad40c92e4b5143bbe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/staudenmeir/laravel-cte/zipball/48cdb4d22bbf3dc1bce3314650659f17fd0e223f", - "reference": "48cdb4d22bbf3dc1bce3314650659f17fd0e223f", + "url": "https://api.github.com/repos/staudenmeir/laravel-cte/zipball/cf59f3b842e411cb22d7446ad40c92e4b5143bbe", + "reference": "cf59f3b842e411cb22d7446ad40c92e4b5143bbe", "shasum": "" }, "require": { - "illuminate/database": "^12.0", - "php": "^8.2" + "illuminate/database": "^13.0", + "php": "^8.3" }, "require-dev": { - "laravel/framework": "^12.0", - "orchestra/testbench-core": "^10.0", + "laravel/framework": "^13.0", + "orchestra/testbench-core": "^11.0", "phpstan/phpstan": "^2.0", - "phpunit/phpunit": "^11.0", - "singlestoredb/singlestoredb-laravel": "^2.0", - "yajra/laravel-oci8": "^12.0" + "phpunit/phpunit": "^12.5" }, "type": "library", "extra": { @@ -8866,7 +8910,7 @@ "description": "Laravel queries with common table expressions", "support": { "issues": "https://github.com/staudenmeir/laravel-cte/issues", - "source": "https://github.com/staudenmeir/laravel-cte/tree/v1.12.4" + "source": "https://github.com/staudenmeir/laravel-cte/tree/v1.13.0" }, "funding": [ { @@ -8874,7 +8918,7 @@ "type": "custom" } ], - "time": "2025-10-21T07:12:06+00:00" + "time": "2026-02-28T20:58:05+00:00" }, { "name": "symfony/clock", @@ -8955,47 +8999,39 @@ }, { "name": "symfony/console", - "version": "v7.4.7", + "version": "v8.0.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "e1e6770440fb9c9b0cf725f81d1361ad1835329d" + "reference": "15ed9008a4ebe2d6a78e4937f74e0c13ef2e618a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/e1e6770440fb9c9b0cf725f81d1361ad1835329d", - "reference": "e1e6770440fb9c9b0cf725f81d1361ad1835329d", + "url": "https://api.github.com/repos/symfony/console/zipball/15ed9008a4ebe2d6a78e4937f74e0c13ef2e618a", + "reference": "15ed9008a4ebe2d6a78e4937f74e0c13ef2e618a", "shasum": "" }, "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-mbstring": "~1.0", + "php": ">=8.4", + "symfony/polyfill-mbstring": "^1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^7.2|^8.0" - }, - "conflict": { - "symfony/dependency-injection": "<6.4", - "symfony/dotenv": "<6.4", - "symfony/event-dispatcher": "<6.4", - "symfony/lock": "<6.4", - "symfony/process": "<6.4" + "symfony/string": "^7.4|^8.0" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^6.4|^7.0|^8.0", - "symfony/dependency-injection": "^6.4|^7.0|^8.0", - "symfony/event-dispatcher": "^6.4|^7.0|^8.0", - "symfony/http-foundation": "^6.4|^7.0|^8.0", - "symfony/http-kernel": "^6.4|^7.0|^8.0", - "symfony/lock": "^6.4|^7.0|^8.0", - "symfony/messenger": "^6.4|^7.0|^8.0", - "symfony/process": "^6.4|^7.0|^8.0", - "symfony/stopwatch": "^6.4|^7.0|^8.0", - "symfony/var-dumper": "^6.4|^7.0|^8.0" + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/event-dispatcher": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/lock": "^7.4|^8.0", + "symfony/messenger": "^7.4|^8.0", + "symfony/process": "^7.4|^8.0", + "symfony/stopwatch": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -9029,7 +9065,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.4.7" + "source": "https://github.com/symfony/console/tree/v8.0.7" }, "funding": [ { @@ -9049,7 +9085,7 @@ "type": "tidelift" } ], - "time": "2026-03-06T14:06:20+00:00" + "time": "2026-03-06T14:06:22+00:00" }, { "name": "symfony/css-selector", @@ -9189,33 +9225,32 @@ }, { "name": "symfony/error-handler", - "version": "v7.4.4", + "version": "v8.0.4", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "8da531f364ddfee53e36092a7eebbbd0b775f6b8" + "reference": "7620b97ec0ab1d2d6c7fb737aa55da411bea776a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/8da531f364ddfee53e36092a7eebbbd0b775f6b8", - "reference": "8da531f364ddfee53e36092a7eebbbd0b775f6b8", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/7620b97ec0ab1d2d6c7fb737aa55da411bea776a", + "reference": "7620b97ec0ab1d2d6c7fb737aa55da411bea776a", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.4", "psr/log": "^1|^2|^3", "symfony/polyfill-php85": "^1.32", - "symfony/var-dumper": "^6.4|^7.0|^8.0" + "symfony/var-dumper": "^7.4|^8.0" }, "conflict": { - "symfony/deprecation-contracts": "<2.5", - "symfony/http-kernel": "<6.4" + "symfony/deprecation-contracts": "<2.5" }, "require-dev": { - "symfony/console": "^6.4|^7.0|^8.0", + "symfony/console": "^7.4|^8.0", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-kernel": "^6.4|^7.0|^8.0", - "symfony/serializer": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0", "symfony/webpack-encore-bundle": "^1.0|^2.0" }, "bin": [ @@ -9247,7 +9282,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v7.4.4" + "source": "https://github.com/symfony/error-handler/tree/v8.0.4" }, "funding": [ { @@ -9267,7 +9302,7 @@ "type": "tidelift" } ], - "time": "2026-01-20T16:42:42+00:00" + "time": "2026-01-23T11:07:10+00:00" }, { "name": "symfony/event-dispatcher", @@ -9502,23 +9537,23 @@ }, { "name": "symfony/finder", - "version": "v7.4.6", + "version": "v8.0.6", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "8655bf1076b7a3a346cb11413ffdabff50c7ffcf" + "reference": "441404f09a54de6d1bd6ad219e088cdf4c91f97c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/8655bf1076b7a3a346cb11413ffdabff50c7ffcf", - "reference": "8655bf1076b7a3a346cb11413ffdabff50c7ffcf", + "url": "https://api.github.com/repos/symfony/finder/zipball/441404f09a54de6d1bd6ad219e088cdf4c91f97c", + "reference": "441404f09a54de6d1bd6ad219e088cdf4c91f97c", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.4" }, "require-dev": { - "symfony/filesystem": "^6.4|^7.0|^8.0" + "symfony/filesystem": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -9546,7 +9581,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.4.6" + "source": "https://github.com/symfony/finder/tree/v8.0.6" }, "funding": [ { @@ -9566,7 +9601,7 @@ "type": "tidelift" } ], - "time": "2026-01-29T09:40:50+00:00" + "time": "2026-01-29T09:41:02+00:00" }, { "name": "symfony/html-sanitizer", @@ -9818,37 +9853,35 @@ }, { "name": "symfony/http-foundation", - "version": "v7.4.7", + "version": "v8.0.7", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "f94b3e7b7dafd40e666f0c9ff2084133bae41e81" + "reference": "c5ecf7b07408dbc4a87482634307654190954ae8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/f94b3e7b7dafd40e666f0c9ff2084133bae41e81", - "reference": "f94b3e7b7dafd40e666f0c9ff2084133bae41e81", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/c5ecf7b07408dbc4a87482634307654190954ae8", + "reference": "c5ecf7b07408dbc4a87482634307654190954ae8", "shasum": "" }, "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.4", "symfony/polyfill-mbstring": "^1.1" }, "conflict": { - "doctrine/dbal": "<3.6", - "symfony/cache": "<6.4.12|>=7.0,<7.1.5" + "doctrine/dbal": "<4.3" }, "require-dev": { - "doctrine/dbal": "^3.6|^4", + "doctrine/dbal": "^4.3", "predis/predis": "^1.1|^2.0", - "symfony/cache": "^6.4.12|^7.1.5|^8.0", - "symfony/clock": "^6.4|^7.0|^8.0", - "symfony/dependency-injection": "^6.4|^7.0|^8.0", - "symfony/expression-language": "^6.4|^7.0|^8.0", - "symfony/http-kernel": "^6.4|^7.0|^8.0", - "symfony/mime": "^6.4|^7.0|^8.0", - "symfony/rate-limiter": "^6.4|^7.0|^8.0" + "symfony/cache": "^7.4|^8.0", + "symfony/clock": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/mime": "^7.4|^8.0", + "symfony/rate-limiter": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -9876,7 +9909,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v7.4.7" + "source": "https://github.com/symfony/http-foundation/tree/v8.0.7" }, "funding": [ { @@ -9896,78 +9929,63 @@ "type": "tidelift" } ], - "time": "2026-03-06T13:15:18+00:00" + "time": "2026-03-06T13:17:40+00:00" }, { "name": "symfony/http-kernel", - "version": "v7.4.7", + "version": "v8.0.7", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "3b3fcf386c809be990c922e10e4c620d6367cab1" + "reference": "c04721f45723d8ce049fa3eee378b5a505272ac7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/3b3fcf386c809be990c922e10e4c620d6367cab1", - "reference": "3b3fcf386c809be990c922e10e4c620d6367cab1", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/c04721f45723d8ce049fa3eee378b5a505272ac7", + "reference": "c04721f45723d8ce049fa3eee378b5a505272ac7", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.4", "psr/log": "^1|^2|^3", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/error-handler": "^6.4|^7.0|^8.0", - "symfony/event-dispatcher": "^7.3|^8.0", + "symfony/error-handler": "^7.4|^8.0", + "symfony/event-dispatcher": "^7.4|^8.0", "symfony/http-foundation": "^7.4|^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "symfony/browser-kit": "<6.4", - "symfony/cache": "<6.4", - "symfony/config": "<6.4", - "symfony/console": "<6.4", - "symfony/dependency-injection": "<6.4", - "symfony/doctrine-bridge": "<6.4", "symfony/flex": "<2.10", - "symfony/form": "<6.4", - "symfony/http-client": "<6.4", "symfony/http-client-contracts": "<2.5", - "symfony/mailer": "<6.4", - "symfony/messenger": "<6.4", - "symfony/translation": "<6.4", "symfony/translation-contracts": "<2.5", - "symfony/twig-bridge": "<6.4", - "symfony/validator": "<6.4", - "symfony/var-dumper": "<6.4", - "twig/twig": "<3.12" + "twig/twig": "<3.21" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/cache": "^1.0|^2.0|^3.0", - "symfony/browser-kit": "^6.4|^7.0|^8.0", - "symfony/clock": "^6.4|^7.0|^8.0", - "symfony/config": "^6.4|^7.0|^8.0", - "symfony/console": "^6.4|^7.0|^8.0", - "symfony/css-selector": "^6.4|^7.0|^8.0", - "symfony/dependency-injection": "^6.4.1|^7.0.1|^8.0", - "symfony/dom-crawler": "^6.4|^7.0|^8.0", - "symfony/expression-language": "^6.4|^7.0|^8.0", - "symfony/finder": "^6.4|^7.0|^8.0", + "symfony/browser-kit": "^7.4|^8.0", + "symfony/clock": "^7.4|^8.0", + "symfony/config": "^7.4|^8.0", + "symfony/console": "^7.4|^8.0", + "symfony/css-selector": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/dom-crawler": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/finder": "^7.4|^8.0", "symfony/http-client-contracts": "^2.5|^3", - "symfony/process": "^6.4|^7.0|^8.0", - "symfony/property-access": "^7.1|^8.0", - "symfony/routing": "^6.4|^7.0|^8.0", - "symfony/serializer": "^7.1|^8.0", - "symfony/stopwatch": "^6.4|^7.0|^8.0", - "symfony/translation": "^6.4|^7.0|^8.0", + "symfony/process": "^7.4|^8.0", + "symfony/property-access": "^7.4|^8.0", + "symfony/routing": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0", + "symfony/stopwatch": "^7.4|^8.0", + "symfony/translation": "^7.4|^8.0", "symfony/translation-contracts": "^2.5|^3", - "symfony/uid": "^6.4|^7.0|^8.0", - "symfony/validator": "^6.4|^7.0|^8.0", - "symfony/var-dumper": "^6.4|^7.0|^8.0", - "symfony/var-exporter": "^6.4|^7.0|^8.0", - "twig/twig": "^3.12" + "symfony/uid": "^7.4|^8.0", + "symfony/validator": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0", + "symfony/var-exporter": "^7.4|^8.0", + "twig/twig": "^3.21" }, "type": "library", "autoload": { @@ -9995,7 +10013,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v7.4.7" + "source": "https://github.com/symfony/http-kernel/tree/v8.0.7" }, "funding": [ { @@ -10015,7 +10033,7 @@ "type": "tidelift" } ], - "time": "2026-03-06T16:33:18+00:00" + "time": "2026-03-06T16:58:46+00:00" }, { "name": "symfony/mailer", @@ -10176,40 +10194,37 @@ }, { "name": "symfony/mime", - "version": "v7.4.7", + "version": "v8.0.7", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "da5ab4fde3f6c88ab06e96185b9922f48b677cd1" + "reference": "5d26d1958aeeba2ace8cc64a3a93d4f5d8f8022b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/da5ab4fde3f6c88ab06e96185b9922f48b677cd1", - "reference": "da5ab4fde3f6c88ab06e96185b9922f48b677cd1", + "url": "https://api.github.com/repos/symfony/mime/zipball/5d26d1958aeeba2ace8cc64a3a93d4f5d8f8022b", + "reference": "5d26d1958aeeba2ace8cc64a3a93d4f5d8f8022b", "shasum": "" }, "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.4", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0" }, "conflict": { "egulias/email-validator": "~3.0.0", "phpdocumentor/reflection-docblock": "<5.2|>=7", - "phpdocumentor/type-resolver": "<1.5.1", - "symfony/mailer": "<6.4", - "symfony/serializer": "<6.4.3|>7.0,<7.0.3" + "phpdocumentor/type-resolver": "<1.5.1" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1|^4", "league/html-to-markdown": "^5.0", "phpdocumentor/reflection-docblock": "^5.2|^6.0", - "symfony/dependency-injection": "^6.4|^7.0|^8.0", - "symfony/process": "^6.4|^7.0|^8.0", - "symfony/property-access": "^6.4|^7.0|^8.0", - "symfony/property-info": "^6.4|^7.0|^8.0", - "symfony/serializer": "^6.4.3|^7.0.3|^8.0" + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/process": "^7.4|^8.0", + "symfony/property-access": "^7.4|^8.0", + "symfony/property-info": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -10241,7 +10256,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v7.4.7" + "source": "https://github.com/symfony/mime/tree/v8.0.7" }, "funding": [ { @@ -10261,7 +10276,7 @@ "type": "tidelift" } ], - "time": "2026-03-05T15:24:09+00:00" + "time": "2026-03-06T13:17:40+00:00" }, { "name": "symfony/polyfill-ctype", @@ -11174,20 +11189,20 @@ }, { "name": "symfony/process", - "version": "v7.4.5", + "version": "v8.0.5", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "608476f4604102976d687c483ac63a79ba18cc97" + "reference": "b5f3aa6762e33fd95efbaa2ec4f4bc9fdd16d674" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/608476f4604102976d687c483ac63a79ba18cc97", - "reference": "608476f4604102976d687c483ac63a79ba18cc97", + "url": "https://api.github.com/repos/symfony/process/zipball/b5f3aa6762e33fd95efbaa2ec4f4bc9fdd16d674", + "reference": "b5f3aa6762e33fd95efbaa2ec4f4bc9fdd16d674", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.4" }, "type": "library", "autoload": { @@ -11215,7 +11230,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.4.5" + "source": "https://github.com/symfony/process/tree/v8.0.5" }, "funding": [ { @@ -11235,38 +11250,33 @@ "type": "tidelift" } ], - "time": "2026-01-26T15:07:59+00:00" + "time": "2026-01-26T15:08:38+00:00" }, { "name": "symfony/routing", - "version": "v7.4.6", + "version": "v8.0.6", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "238d749c56b804b31a9bf3e26519d93b65a60938" + "reference": "053c40fd46e1d19c5c5a94cada93ce6c3facdd55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/238d749c56b804b31a9bf3e26519d93b65a60938", - "reference": "238d749c56b804b31a9bf3e26519d93b65a60938", + "url": "https://api.github.com/repos/symfony/routing/zipball/053c40fd46e1d19c5c5a94cada93ce6c3facdd55", + "reference": "053c40fd46e1d19c5c5a94cada93ce6c3facdd55", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.4", "symfony/deprecation-contracts": "^2.5|^3" }, - "conflict": { - "symfony/config": "<6.4", - "symfony/dependency-injection": "<6.4", - "symfony/yaml": "<6.4" - }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^6.4|^7.0|^8.0", - "symfony/dependency-injection": "^6.4|^7.0|^8.0", - "symfony/expression-language": "^6.4|^7.0|^8.0", - "symfony/http-foundation": "^6.4|^7.0|^8.0", - "symfony/yaml": "^6.4|^7.0|^8.0" + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/yaml": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -11300,7 +11310,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v7.4.6" + "source": "https://github.com/symfony/routing/tree/v8.0.6" }, "funding": [ { @@ -11320,7 +11330,7 @@ "type": "tidelift" } ], - "time": "2026-02-25T16:50:00+00:00" + "time": "2026-02-25T16:59:43+00:00" }, { "name": "symfony/service-contracts", @@ -11676,24 +11686,24 @@ }, { "name": "symfony/uid", - "version": "v7.4.4", + "version": "v8.0.4", "source": { "type": "git", "url": "https://github.com/symfony/uid.git", - "reference": "7719ce8aba76be93dfe249192f1fbfa52c588e36" + "reference": "8b81bd3700f5c1913c22a3266a647aa1bb974435" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/uid/zipball/7719ce8aba76be93dfe249192f1fbfa52c588e36", - "reference": "7719ce8aba76be93dfe249192f1fbfa52c588e36", + "url": "https://api.github.com/repos/symfony/uid/zipball/8b81bd3700f5c1913c22a3266a647aa1bb974435", + "reference": "8b81bd3700f5c1913c22a3266a647aa1bb974435", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.4", "symfony/polyfill-uuid": "^1.15" }, "require-dev": { - "symfony/console": "^6.4|^7.0|^8.0" + "symfony/console": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -11730,7 +11740,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/uid/tree/v7.4.4" + "source": "https://github.com/symfony/uid/tree/v8.0.4" }, "funding": [ { @@ -11750,35 +11760,35 @@ "type": "tidelift" } ], - "time": "2026-01-03T23:30:35+00:00" + "time": "2026-01-03T23:40:55+00:00" }, { "name": "symfony/var-dumper", - "version": "v7.4.6", + "version": "v8.0.6", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "045321c440ac18347b136c63d2e9bf28a2dc0291" + "reference": "2e14f7e0bf5ff02c6e63bd31cb8e4855a13d6209" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/045321c440ac18347b136c63d2e9bf28a2dc0291", - "reference": "045321c440ac18347b136c63d2e9bf28a2dc0291", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2e14f7e0bf5ff02c6e63bd31cb8e4855a13d6209", + "reference": "2e14f7e0bf5ff02c6e63bd31cb8e4855a13d6209", "shasum": "" }, "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=8.4", + "symfony/polyfill-mbstring": "^1.0" }, "conflict": { - "symfony/console": "<6.4" + "symfony/console": "<7.4", + "symfony/error-handler": "<7.4" }, "require-dev": { - "symfony/console": "^6.4|^7.0|^8.0", - "symfony/http-kernel": "^6.4|^7.0|^8.0", - "symfony/process": "^6.4|^7.0|^8.0", - "symfony/uid": "^6.4|^7.0|^8.0", + "symfony/console": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/process": "^7.4|^8.0", + "symfony/uid": "^7.4|^8.0", "twig/twig": "^3.12" }, "bin": [ @@ -11817,7 +11827,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v7.4.6" + "source": "https://github.com/symfony/var-dumper/tree/v8.0.6" }, "funding": [ { @@ -11837,7 +11847,7 @@ "type": "tidelift" } ], - "time": "2026-02-15T10:53:20+00:00" + "time": "2026-02-15T10:53:29+00:00" }, { "name": "textalk/websocket", @@ -12157,30 +12167,30 @@ }, { "name": "vinkla/hashids", - "version": "13.0.0", + "version": "14.0.0", "source": { "type": "git", "url": "https://github.com/vinkla/laravel-hashids.git", - "reference": "f59ebf0d223b4986c4bdc76e6e694bf6056f8a0a" + "reference": "76b31ac86114664bd9f9dbb20c61aeb04a014f70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vinkla/laravel-hashids/zipball/f59ebf0d223b4986c4bdc76e6e694bf6056f8a0a", - "reference": "f59ebf0d223b4986c4bdc76e6e694bf6056f8a0a", + "url": "https://api.github.com/repos/vinkla/laravel-hashids/zipball/76b31ac86114664bd9f9dbb20c61aeb04a014f70", + "reference": "76b31ac86114664bd9f9dbb20c61aeb04a014f70", "shasum": "" }, "require": { - "graham-campbell/manager": "^5.2", + "graham-campbell/manager": "^5.3", "hashids/hashids": "^5.0", - "illuminate/contracts": "^12.0", - "illuminate/support": "^12.0", - "php": "^8.2" + "illuminate/contracts": "^13.0", + "illuminate/support": "^13.0", + "php": "^8.3" }, "require-dev": { - "graham-campbell/analyzer": "^5.0", + "graham-campbell/analyzer": "^5.1", "graham-campbell/testbench": "^6.1", "mockery/mockery": "^1.6.6", - "phpunit/phpunit": "^11.5" + "phpunit/phpunit": "^12.5 || ^13.0" }, "type": "library", "extra": { @@ -12191,9 +12201,6 @@ "providers": [ "Vinkla\\Hashids\\HashidsServiceProvider" ] - }, - "branch-alias": { - "dev-master": "12.0-dev" } }, "autoload": { @@ -12218,9 +12225,9 @@ ], "support": { "issues": "https://github.com/vinkla/laravel-hashids/issues", - "source": "https://github.com/vinkla/laravel-hashids/tree/13.0.0" + "source": "https://github.com/vinkla/laravel-hashids/tree/14.0.0" }, - "time": "2025-03-02T21:39:35+00:00" + "time": "2026-03-22T07:23:47+00:00" }, { "name": "vlucas/phpdotenv", @@ -12463,16 +12470,16 @@ "packages-dev": [ { "name": "brianium/paratest", - "version": "v7.19.0", + "version": "v7.19.2", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "7c6c29af7c4b406b49ce0c6b0a3a81d3684474e6" + "reference": "66e4f7910cecf67736bccf2b8bd53a2e3eb98bd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/7c6c29af7c4b406b49ce0c6b0a3a81d3684474e6", - "reference": "7c6c29af7c4b406b49ce0c6b0a3a81d3684474e6", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/66e4f7910cecf67736bccf2b8bd53a2e3eb98bd9", + "reference": "66e4f7910cecf67736bccf2b8bd53a2e3eb98bd9", "shasum": "" }, "require": { @@ -12486,9 +12493,9 @@ "phpunit/php-code-coverage": "^12.5.3 || ^13.0.1", "phpunit/php-file-iterator": "^6.0.1 || ^7", "phpunit/php-timer": "^8 || ^9", - "phpunit/phpunit": "^12.5.9 || ^13", + "phpunit/phpunit": "^12.5.14 || ^13.0.5", "sebastian/environment": "^8.0.3 || ^9", - "symfony/console": "^7.4.4 || ^8.0.4", + "symfony/console": "^7.4.7 || ^8.0.7", "symfony/process": "^7.4.5 || ^8.0.5" }, "require-dev": { @@ -12496,11 +12503,11 @@ "ext-pcntl": "*", "ext-pcov": "*", "ext-posix": "*", - "phpstan/phpstan": "^2.1.38", - "phpstan/phpstan-deprecation-rules": "^2.0.3", - "phpstan/phpstan-phpunit": "^2.0.12", - "phpstan/phpstan-strict-rules": "^2.0.8", - "symfony/filesystem": "^7.4.0 || ^8.0.1" + "phpstan/phpstan": "^2.1.40", + "phpstan/phpstan-deprecation-rules": "^2.0.4", + "phpstan/phpstan-phpunit": "^2.0.16", + "phpstan/phpstan-strict-rules": "^2.0.10", + "symfony/filesystem": "^7.4.6 || ^8.0.6" }, "bin": [ "bin/paratest", @@ -12540,7 +12547,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.19.0" + "source": "https://github.com/paratestphp/paratest/tree/v7.19.2" }, "funding": [ { @@ -12552,7 +12559,7 @@ "type": "paypal" } ], - "time": "2026-02-06T10:53:26+00:00" + "time": "2026-03-09T14:33:17+00:00" }, { "name": "doctrine/deprecations", @@ -13422,20 +13429,20 @@ }, { "name": "pestphp/pest", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "5d42e8fe3ae1d9fdf7c9f73ee88138fd30265701" + "reference": "e6ab897594312728ef2e32d586cb4f6780b1b495" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/5d42e8fe3ae1d9fdf7c9f73ee88138fd30265701", - "reference": "5d42e8fe3ae1d9fdf7c9f73ee88138fd30265701", + "url": "https://api.github.com/repos/pestphp/pest/zipball/e6ab897594312728ef2e32d586cb4f6780b1b495", + "reference": "e6ab897594312728ef2e32d586cb4f6780b1b495", "shasum": "" }, "require": { - "brianium/paratest": "^7.19.0", + "brianium/paratest": "^7.19.2", "nunomaduro/collision": "^8.9.1", "nunomaduro/termwind": "^2.4.0", "pestphp/pest-plugin": "^4.0.0", @@ -13443,12 +13450,12 @@ "pestphp/pest-plugin-mutate": "^4.0.1", "pestphp/pest-plugin-profanity": "^4.2.1", "php": "^8.3.0", - "phpunit/phpunit": "^12.5.12", + "phpunit/phpunit": "^12.5.14", "symfony/process": "^7.4.5|^8.0.5" }, "conflict": { "filp/whoops": "<2.18.3", - "phpunit/phpunit": ">12.5.12", + "phpunit/phpunit": ">12.5.14", "sebastian/exporter": "<7.0.0", "webmozart/assert": "<1.11.0" }, @@ -13522,7 +13529,7 @@ ], "support": { "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v4.4.2" + "source": "https://github.com/pestphp/pest/tree/v4.4.3" }, "funding": [ { @@ -13534,7 +13541,7 @@ "type": "github" } ], - "time": "2026-03-10T21:09:12+00:00" + "time": "2026-03-21T13:14:39+00:00" }, { "name": "pestphp/pest-plugin", @@ -14739,16 +14746,16 @@ }, { "name": "phpunit/phpunit", - "version": "12.5.12", + "version": "12.5.14", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "418e06b3b46b0d54bad749ff4907fc7dfb530199" + "reference": "47283cfd98d553edcb1353591f4e255dc1bb61f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/418e06b3b46b0d54bad749ff4907fc7dfb530199", - "reference": "418e06b3b46b0d54bad749ff4907fc7dfb530199", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/47283cfd98d553edcb1353591f4e255dc1bb61f0", + "reference": "47283cfd98d553edcb1353591f4e255dc1bb61f0", "shasum": "" }, "require": { @@ -14817,7 +14824,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.12" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.14" }, "funding": [ { @@ -14841,7 +14848,7 @@ "type": "tidelift" } ], - "time": "2026-02-16T08:34:36+00:00" + "time": "2026-02-18T12:38:40+00:00" }, { "name": "predis/predis", @@ -16048,6 +16055,49 @@ ], "time": "2024-03-18T22:02:54+00:00" }, + { + "name": "symplify/vendor-patches", + "version": "12.0.6", + "source": { + "type": "git", + "url": "https://github.com/symplify/vendor-patches.git", + "reference": "096aaab56bcea39e25468f538601fda00c1024bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symplify/vendor-patches/zipball/096aaab56bcea39e25468f538601fda00c1024bb", + "reference": "096aaab56bcea39e25468f538601fda00c1024bb", + "shasum": "" + }, + "require": { + "cweagans/composer-patches": "^1.7.3 || ^2.0", + "php": ">=7.2" + }, + "bin": [ + "bin/vendor-patches" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Generate vendor patches for packages with single command", + "support": { + "issues": "https://github.com/symplify/vendor-patches/issues", + "source": "https://github.com/symplify/vendor-patches/tree/12.0.6" + }, + "funding": [ + { + "url": "https://www.paypal.me/rectorphp", + "type": "custom" + }, + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2026-02-03T10:18:03+00:00" + }, { "name": "ta-tikoma/phpunit-architecture-test", "version": "0.8.7", diff --git a/config/cache.php b/config/cache.php index 4209234d8..d5a7f0f14 100644 --- a/config/cache.php +++ b/config/cache.php @@ -108,6 +108,6 @@ return [ | */ - 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'-cache-'), ]; diff --git a/config/database.php b/config/database.php index a56548073..c9e432353 100644 --- a/config/database.php +++ b/config/database.php @@ -185,7 +185,7 @@ return [ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'-database-'), 'scheme' => env('REDIS_SCHEME', 'tcp'), ], diff --git a/config/sanctum.php b/config/sanctum.php index 3a24717ca..484450ac1 100644 --- a/config/sanctum.php +++ b/config/sanctum.php @@ -65,7 +65,7 @@ return [ 'middleware' => [ 'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class, 'encrypt_cookies' => Illuminate\Cookie\Middleware\EncryptCookies::class, - 'validate_csrf_token' => Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class, + 'validate_csrf_token' => Illuminate\Foundation\Http\Middleware\PreventRequestForgery::class, ], ]; diff --git a/config/session.php b/config/session.php index 2d0509228..e67f55060 100644 --- a/config/session.php +++ b/config/session.php @@ -130,7 +130,7 @@ return [ 'cookie' => env( 'SESSION_COOKIE', - Str::slug(env('APP_NAME', 'laravel'), '_').'_session' + Str::snake(env('APP_NAME', 'laravel'), '_').'_session' ), /* diff --git a/database/factories/Admin/AnnouncementFactory.php b/database/factories/Admin/AnnouncementFactory.php index 3e506f6de..e619dac01 100644 --- a/database/factories/Admin/AnnouncementFactory.php +++ b/database/factories/Admin/AnnouncementFactory.php @@ -6,6 +6,7 @@ namespace Database\Factories\Admin; use App\Enums\Http\Api\Filter\AllowedDateFormat; use App\Models\Admin\Announcement; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; /** @@ -14,15 +15,9 @@ use Illuminate\Database\Eloquent\Factories\Factory; * * @extends Factory */ +#[UseModel(Announcement::class)] class AnnouncementFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = Announcement::class; - /** * Define the model's default state. * diff --git a/database/factories/Admin/DumpFactory.php b/database/factories/Admin/DumpFactory.php index 32e2b0b76..432d01c6e 100644 --- a/database/factories/Admin/DumpFactory.php +++ b/database/factories/Admin/DumpFactory.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Database\Factories\Admin; use App\Models\Admin\Dump; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; @@ -14,15 +15,9 @@ use Illuminate\Support\Str; * * @extends Factory */ +#[UseModel(Dump::class)] class DumpFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = Dump::class; - /** * Define the model's default state. * diff --git a/database/factories/Admin/FeatureFactory.php b/database/factories/Admin/FeatureFactory.php index fd519b987..2fb0d1efe 100644 --- a/database/factories/Admin/FeatureFactory.php +++ b/database/factories/Admin/FeatureFactory.php @@ -6,6 +6,7 @@ namespace Database\Factories\Admin; use App\Constants\FeatureConstants; use App\Models\Admin\Feature; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; /** @@ -14,15 +15,9 @@ use Illuminate\Database\Eloquent\Factories\Factory; * * @extends Factory */ +#[UseModel(Feature::class)] class FeatureFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = Feature::class; - /** * Define the model's default state. * diff --git a/database/factories/Admin/FeaturedThemeFactory.php b/database/factories/Admin/FeaturedThemeFactory.php index 5f7d2d817..e2fd4f2d9 100644 --- a/database/factories/Admin/FeaturedThemeFactory.php +++ b/database/factories/Admin/FeaturedThemeFactory.php @@ -6,6 +6,7 @@ namespace Database\Factories\Admin; use App\Enums\Http\Api\Filter\AllowedDateFormat; use App\Models\Admin\FeaturedTheme; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; /** @@ -14,15 +15,9 @@ use Illuminate\Database\Eloquent\Factories\Factory; * * @extends Factory */ +#[UseModel(FeaturedTheme::class)] class FeaturedThemeFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = FeaturedTheme::class; - /** * Define the model's default state. * diff --git a/database/factories/Auth/UserFactory.php b/database/factories/Auth/UserFactory.php index 59954e724..f1fe466f4 100644 --- a/database/factories/Auth/UserFactory.php +++ b/database/factories/Auth/UserFactory.php @@ -7,6 +7,7 @@ namespace Database\Factories\Auth; use App\Models\Auth\Permission; use App\Models\Auth\Role; use App\Models\Auth\User; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Arr; use Illuminate\Support\Facades\App; @@ -20,15 +21,9 @@ use Spatie\Permission\PermissionRegistrar; * * @extends Factory */ +#[UseModel(User::class)] class UserFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = User::class; - /** * Define the model's default state. * diff --git a/database/factories/Discord/DiscordThreadFactory.php b/database/factories/Discord/DiscordThreadFactory.php index 22a28b08f..6d1d1c3fd 100644 --- a/database/factories/Discord/DiscordThreadFactory.php +++ b/database/factories/Discord/DiscordThreadFactory.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Database\Factories\Discord; use App\Models\Discord\DiscordThread; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; /** @@ -13,15 +14,9 @@ use Illuminate\Database\Eloquent\Factories\Factory; * * @extends Factory */ +#[UseModel(DiscordThread::class)] class DiscordThreadFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = DiscordThread::class; - /** * Define the model's default state. * diff --git a/database/factories/Document/PageFactory.php b/database/factories/Document/PageFactory.php index 92f1183ab..b06540ada 100644 --- a/database/factories/Document/PageFactory.php +++ b/database/factories/Document/PageFactory.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Database\Factories\Document; use App\Models\Document\Page; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; @@ -14,15 +15,9 @@ use Illuminate\Support\Str; * * @extends Factory */ +#[UseModel(Page::class)] class PageFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = Page::class; - /** * Define the model's default state. * diff --git a/database/factories/List/External/ExternalEntryFactory.php b/database/factories/List/External/ExternalEntryFactory.php index 48b45695d..70b3aaf74 100644 --- a/database/factories/List/External/ExternalEntryFactory.php +++ b/database/factories/List/External/ExternalEntryFactory.php @@ -4,8 +4,9 @@ declare(strict_types=1); namespace Database\Factories\List\External; -use App\Enums\Models\List\ExternalEntryWatchStatus; +use App\Enums\Models\List\ExternalEntryStatus; use App\Models\List\External\ExternalEntry; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Arr; @@ -15,15 +16,9 @@ use Illuminate\Support\Arr; * * @extends Factory */ +#[UseModel(ExternalEntry::class)] class ExternalEntryFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = ExternalEntry::class; - /** * Define the model's default state. * @@ -31,10 +26,10 @@ class ExternalEntryFactory extends Factory */ public function definition(): array { - $watchStatus = Arr::random(ExternalEntryWatchStatus::cases()); + $status = Arr::random(ExternalEntryStatus::cases()); return [ - ExternalEntry::ATTRIBUTE_WATCH_STATUS => $watchStatus->value, + ExternalEntry::ATTRIBUTE_STATUS => $status->value, ExternalEntry::ATTRIBUTE_SCORE => fake()->randomFloat(2), ExternalEntry::ATTRIBUTE_IS_FAVORITE => fake()->boolean(), ]; diff --git a/database/factories/List/External/ExternalTokenFactory.php b/database/factories/List/External/ExternalTokenFactory.php index 38956453a..dc8879827 100644 --- a/database/factories/List/External/ExternalTokenFactory.php +++ b/database/factories/List/External/ExternalTokenFactory.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Database\Factories\List\External; use App\Models\List\External\ExternalToken; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Facades\Hash; @@ -14,15 +15,9 @@ use Illuminate\Support\Facades\Hash; * * @extends Factory */ +#[UseModel(ExternalToken::class)] class ExternalTokenFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = ExternalToken::class; - /** * Define the model's default state. * diff --git a/database/factories/List/ExternalProfileFactory.php b/database/factories/List/ExternalProfileFactory.php index 796c029f6..ce31fde7c 100644 --- a/database/factories/List/ExternalProfileFactory.php +++ b/database/factories/List/ExternalProfileFactory.php @@ -4,12 +4,13 @@ declare(strict_types=1); namespace Database\Factories\List; -use App\Enums\Models\List\ExternalEntryWatchStatus; +use App\Enums\Models\List\ExternalEntryStatus; use App\Enums\Models\List\ExternalProfileSite; use App\Enums\Models\List\ExternalProfileVisibility; use App\Models\List\External\ExternalEntry; use App\Models\List\ExternalProfile; use App\Models\Wiki\Anime; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Arr; @@ -19,15 +20,9 @@ use Illuminate\Support\Arr; * * @extends Factory */ +#[UseModel(ExternalProfile::class)] class ExternalProfileFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = ExternalProfile::class; - /** * Define the model's default state. * @@ -60,7 +55,7 @@ class ExternalProfileFactory extends Factory $entry->is_favorite = fake()->boolean(); $entry->score = fake()->numberBetween(1, 10); - $entry->watch_status = Arr::random(ExternalEntryWatchStatus::cases())->value; + $entry->status = Arr::random(ExternalEntryStatus::cases())->value; $entry->save(); } } @@ -84,7 +79,7 @@ class ExternalProfileFactory extends Factory $entry->is_favorite = fake()->boolean(); $entry->score = fake()->numberBetween(1, 10); - $entry->watch_status = Arr::random(ExternalEntryWatchStatus::cases())->value; + $entry->status = Arr::random(ExternalEntryStatus::cases())->value; $entry->save(); } } diff --git a/database/factories/List/Playlist/PlaylistTrackFactory.php b/database/factories/List/Playlist/PlaylistTrackFactory.php index c46d740cb..a30b99cd9 100644 --- a/database/factories/List/Playlist/PlaylistTrackFactory.php +++ b/database/factories/List/Playlist/PlaylistTrackFactory.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Database\Factories\List\Playlist; use App\Models\List\Playlist\PlaylistTrack; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; /** @@ -13,15 +14,9 @@ use Illuminate\Database\Eloquent\Factories\Factory; * * @extends Factory */ +#[UseModel(PlaylistTrack::class)] class PlaylistTrackFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = PlaylistTrack::class; - /** * Define the model's default state. * diff --git a/database/factories/List/PlaylistFactory.php b/database/factories/List/PlaylistFactory.php index 71d40db99..a041b93e0 100644 --- a/database/factories/List/PlaylistFactory.php +++ b/database/factories/List/PlaylistFactory.php @@ -10,6 +10,7 @@ use App\Models\List\Playlist\PlaylistTrack; use App\Models\Wiki\Anime\Theme\AnimeThemeEntry; use App\Models\Wiki\Video; use App\Pivots\Wiki\AnimeThemeEntryVideo; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Arr; @@ -19,15 +20,9 @@ use Illuminate\Support\Arr; * * @extends Factory */ +#[UseModel(Playlist::class)] class PlaylistFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = Playlist::class; - /** * Define the model's default state. * diff --git a/database/factories/Pivots/Document/PageRoleFactory.php b/database/factories/Pivots/Document/PageRoleFactory.php index eac557673..694e149e4 100644 --- a/database/factories/Pivots/Document/PageRoleFactory.php +++ b/database/factories/Pivots/Document/PageRoleFactory.php @@ -6,6 +6,7 @@ namespace Database\Factories\Pivots\Document; use App\Enums\Pivots\Document\PageRoleType; use App\Pivots\Document\PageRole; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Arr; @@ -15,15 +16,9 @@ use Illuminate\Support\Arr; * * @extends Factory */ +#[UseModel(PageRole::class)] class PageRoleFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = PageRole::class; - /** * Define the model's default state. * diff --git a/database/factories/Pivots/Morph/ImageableFactory.php b/database/factories/Pivots/Morph/ImageableFactory.php index 6df145e97..96bb2e8e2 100644 --- a/database/factories/Pivots/Morph/ImageableFactory.php +++ b/database/factories/Pivots/Morph/ImageableFactory.php @@ -10,6 +10,7 @@ use App\Models\Wiki\Anime; use App\Models\Wiki\Artist; use App\Models\Wiki\Studio; use App\Pivots\Morph\Imageable; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; /** @@ -18,15 +19,9 @@ use Illuminate\Database\Eloquent\Factories\Factory; * * @extends Factory */ +#[UseModel(Imageable::class)] class ImageableFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = Imageable::class; - /** * Define the model's default state. * diff --git a/database/factories/Pivots/Morph/ResourceableFactory.php b/database/factories/Pivots/Morph/ResourceableFactory.php index e89565e50..d87677364 100644 --- a/database/factories/Pivots/Morph/ResourceableFactory.php +++ b/database/factories/Pivots/Morph/ResourceableFactory.php @@ -9,6 +9,7 @@ use App\Models\Wiki\Artist; use App\Models\Wiki\Song; use App\Models\Wiki\Studio; use App\Pivots\Morph\Resourceable; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; @@ -18,15 +19,9 @@ use Illuminate\Support\Str; * * @extends Factory */ +#[UseModel(Resourceable::class)] class ResourceableFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = Resourceable::class; - /** * Define the model's default state. * diff --git a/database/factories/Pivots/Wiki/AnimeSeriesFactory.php b/database/factories/Pivots/Wiki/AnimeSeriesFactory.php index 3bf503044..2ecbc4a1c 100644 --- a/database/factories/Pivots/Wiki/AnimeSeriesFactory.php +++ b/database/factories/Pivots/Wiki/AnimeSeriesFactory.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Database\Factories\Pivots\Wiki; use App\Pivots\Wiki\AnimeSeries; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; /** @@ -13,15 +14,9 @@ use Illuminate\Database\Eloquent\Factories\Factory; * * @extends Factory */ +#[UseModel(AnimeSeries::class)] class AnimeSeriesFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = AnimeSeries::class; - /** * Define the model's default state. * diff --git a/database/factories/Pivots/Wiki/AnimeStudioFactory.php b/database/factories/Pivots/Wiki/AnimeStudioFactory.php index a4b6bd011..aed5ac93f 100644 --- a/database/factories/Pivots/Wiki/AnimeStudioFactory.php +++ b/database/factories/Pivots/Wiki/AnimeStudioFactory.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Database\Factories\Pivots\Wiki; use App\Pivots\Wiki\AnimeStudio; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; /** @@ -13,15 +14,9 @@ use Illuminate\Database\Eloquent\Factories\Factory; * * @extends Factory */ +#[UseModel(AnimeStudio::class)] class AnimeStudioFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = AnimeStudio::class; - /** * Define the model's default state. * diff --git a/database/factories/Pivots/Wiki/AnimeThemeEntryVideoFactory.php b/database/factories/Pivots/Wiki/AnimeThemeEntryVideoFactory.php index 661374893..cd8d5ad30 100644 --- a/database/factories/Pivots/Wiki/AnimeThemeEntryVideoFactory.php +++ b/database/factories/Pivots/Wiki/AnimeThemeEntryVideoFactory.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Database\Factories\Pivots\Wiki; use App\Pivots\Wiki\AnimeThemeEntryVideo; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; /** @@ -13,15 +14,9 @@ use Illuminate\Database\Eloquent\Factories\Factory; * * @extends Factory */ +#[UseModel(AnimeThemeEntryVideo::class)] class AnimeThemeEntryVideoFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = AnimeThemeEntryVideo::class; - /** * Define the model's default state. * diff --git a/database/factories/Pivots/Wiki/ArtistMemberFactory.php b/database/factories/Pivots/Wiki/ArtistMemberFactory.php index 36fb6b7f7..65cc4470a 100644 --- a/database/factories/Pivots/Wiki/ArtistMemberFactory.php +++ b/database/factories/Pivots/Wiki/ArtistMemberFactory.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Database\Factories\Pivots\Wiki; use App\Pivots\Wiki\ArtistMember; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; @@ -14,15 +15,9 @@ use Illuminate\Support\Str; * * @extends Factory */ +#[UseModel(ArtistMember::class)] class ArtistMemberFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = ArtistMember::class; - /** * Define the model's default state. * diff --git a/database/factories/Pivots/Wiki/ArtistSongFactory.php b/database/factories/Pivots/Wiki/ArtistSongFactory.php index e237763b6..e4f8c868f 100644 --- a/database/factories/Pivots/Wiki/ArtistSongFactory.php +++ b/database/factories/Pivots/Wiki/ArtistSongFactory.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Database\Factories\Pivots\Wiki; use App\Pivots\Wiki\ArtistSong; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; @@ -14,15 +15,9 @@ use Illuminate\Support\Str; * * @extends Factory */ +#[UseModel(ArtistSong::class)] class ArtistSongFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = ArtistSong::class; - /** * Define the model's default state. * diff --git a/database/factories/User/LikeFactory.php b/database/factories/User/LikeFactory.php index 055c77cf4..c42e23250 100644 --- a/database/factories/User/LikeFactory.php +++ b/database/factories/User/LikeFactory.php @@ -8,6 +8,7 @@ use App\Models\Auth\User; use App\Models\List\Playlist; use App\Models\User\Like; use App\Models\Wiki\Anime\Theme\AnimeThemeEntry; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; /** @@ -16,15 +17,9 @@ use Illuminate\Database\Eloquent\Factories\Factory; * * @extends Factory */ +#[UseModel(Like::class)] class LikeFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = Like::class; - /** * Define the model's default state. * diff --git a/database/factories/User/NotificationFactory.php b/database/factories/User/NotificationFactory.php index 29dcf21e3..1d2c58866 100644 --- a/database/factories/User/NotificationFactory.php +++ b/database/factories/User/NotificationFactory.php @@ -6,6 +6,7 @@ namespace Database\Factories\User; use App\Models\User\Notification; use App\Notifications\ExternalProfileSyncedNotification; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; @@ -15,15 +16,9 @@ use Illuminate\Support\Str; * * @extends Factory */ +#[UseModel(Notification::class)] class NotificationFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = Notification::class; - /** * Define the model's default state. * diff --git a/database/factories/User/Submission/SubmissionStageFactory.php b/database/factories/User/Submission/SubmissionStageFactory.php index 28453e557..e742bfb38 100644 --- a/database/factories/User/Submission/SubmissionStageFactory.php +++ b/database/factories/User/Submission/SubmissionStageFactory.php @@ -6,6 +6,7 @@ namespace Database\Factories\User\Submission; use App\Models\User\Submission; use App\Models\User\Submission\SubmissionStage; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; /** @@ -14,15 +15,9 @@ use Illuminate\Database\Eloquent\Factories\Factory; * * @extends Factory */ +#[UseModel(SubmissionStage::class)] class SubmissionStageFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = SubmissionStage::class; - /** * Define the model's default state. * diff --git a/database/factories/User/SubmissionFactory.php b/database/factories/User/SubmissionFactory.php index b0400a434..5a0c67680 100644 --- a/database/factories/User/SubmissionFactory.php +++ b/database/factories/User/SubmissionFactory.php @@ -6,6 +6,7 @@ namespace Database\Factories\User; use App\Enums\Models\User\SubmissionStatus; use App\Models\User\Submission; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Arr; @@ -15,15 +16,9 @@ use Illuminate\Support\Arr; * * @extends Factory */ +#[UseModel(Submission::class)] class SubmissionFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = Submission::class; - /** * Define the model's default state. * diff --git a/database/factories/User/WatchHistoryFactory.php b/database/factories/User/WatchHistoryFactory.php index d92210240..a6df437c3 100644 --- a/database/factories/User/WatchHistoryFactory.php +++ b/database/factories/User/WatchHistoryFactory.php @@ -8,6 +8,7 @@ use App\Models\Auth\User; use App\Models\User\WatchHistory; use App\Models\Wiki\Anime\Theme\AnimeThemeEntry; use App\Models\Wiki\Video; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; /** @@ -16,15 +17,9 @@ use Illuminate\Database\Eloquent\Factories\Factory; * * @extends Factory */ +#[UseModel(WatchHistory::class)] class WatchHistoryFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = WatchHistory::class; - /** * Define the model's default state. * diff --git a/database/factories/Wiki/Anime/AnimeThemeFactory.php b/database/factories/Wiki/Anime/AnimeThemeFactory.php index be4121725..86665d37c 100644 --- a/database/factories/Wiki/Anime/AnimeThemeFactory.php +++ b/database/factories/Wiki/Anime/AnimeThemeFactory.php @@ -7,6 +7,7 @@ namespace Database\Factories\Wiki\Anime; use App\Enums\Models\Wiki\ThemeType; use App\Models\Wiki\Anime; use App\Models\Wiki\Anime\AnimeTheme; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Arr; @@ -16,15 +17,9 @@ use Illuminate\Support\Arr; * * @extends Factory */ +#[UseModel(AnimeTheme::class)] class AnimeThemeFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = AnimeTheme::class; - /** * Define the model's default state. * diff --git a/database/factories/Wiki/Anime/Theme/AnimeThemeEntryFactory.php b/database/factories/Wiki/Anime/Theme/AnimeThemeEntryFactory.php index 99410a92d..7b75d3312 100644 --- a/database/factories/Wiki/Anime/Theme/AnimeThemeEntryFactory.php +++ b/database/factories/Wiki/Anime/Theme/AnimeThemeEntryFactory.php @@ -7,6 +7,7 @@ namespace Database\Factories\Wiki\Anime\Theme; use App\Models\Wiki\Anime; use App\Models\Wiki\Anime\AnimeTheme; use App\Models\Wiki\Anime\Theme\AnimeThemeEntry; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; /** @@ -15,15 +16,9 @@ use Illuminate\Database\Eloquent\Factories\Factory; * * @extends Factory */ +#[UseModel(AnimeThemeEntry::class)] class AnimeThemeEntryFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = AnimeThemeEntry::class; - /** * Define the model's default state. * diff --git a/database/factories/Wiki/AnimeFactory.php b/database/factories/Wiki/AnimeFactory.php index 9562b0c6d..e5668365e 100644 --- a/database/factories/Wiki/AnimeFactory.php +++ b/database/factories/Wiki/AnimeFactory.php @@ -15,6 +15,7 @@ use App\Models\Wiki\Series; use App\Models\Wiki\Song; use App\Models\Wiki\Video; use App\Models\Wiki\Video\VideoScript; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Arr; use Illuminate\Support\Str; @@ -25,15 +26,9 @@ use Illuminate\Support\Str; * * @extends Factory */ +#[UseModel(Anime::class)] class AnimeFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = Anime::class; - /** * Define the model's default state. * diff --git a/database/factories/Wiki/ArtistFactory.php b/database/factories/Wiki/ArtistFactory.php index 0f1aeeb05..acb0574d8 100644 --- a/database/factories/Wiki/ArtistFactory.php +++ b/database/factories/Wiki/ArtistFactory.php @@ -10,6 +10,7 @@ use App\Models\Wiki\Artist; use App\Models\Wiki\ExternalResource; use App\Models\Wiki\Image; use App\Models\Wiki\Song; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; @@ -19,15 +20,9 @@ use Illuminate\Support\Str; * * @extends Factory */ +#[UseModel(Artist::class)] class ArtistFactory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var class-string - */ - protected $model = Artist::class; - /** * Define the model's default state. * diff --git a/database/factories/Wiki/AudioFactory.php b/database/factories/Wiki/AudioFactory.php index 610e8ea91..b526fd55c 100644 --- a/database/factories/Wiki/AudioFactory.php +++ b/database/factories/Wiki/AudioFactory.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Database\Factories\Wiki; use App\Models\Wiki\Audio; +use Illuminate\Database\Eloquent\Factories\Attributes\UseModel; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; @@ -14,15 +15,9 @@ use Illuminate\Support\Str; * * @extends Factory