From 884f6921a0b418b9bcefbd63802bb3e6ec186147 Mon Sep 17 00:00:00 2001 From: Kyrch Date: Fri, 17 Apr 2026 10:45:33 -0300 Subject: [PATCH] feat: unguard models (#1167) --- app/Models/Admin/ActionLog.php | 21 ------------------- app/Models/Admin/Announcement.php | 11 ---------- app/Models/Admin/Dump.php | 10 --------- app/Models/Admin/Feature.php | 9 -------- app/Models/Admin/FeaturedTheme.php | 13 ------------ app/Models/Auth/User.php | 12 ----------- app/Models/Discord/DiscordThread.php | 11 ---------- app/Models/Document/Page.php | 13 ------------ app/Models/List/External/ExternalEntry.php | 13 ------------ app/Models/List/External/ExternalToken.php | 11 ---------- app/Models/List/ExternalProfile.php | 14 ------------- app/Models/List/Playlist.php | 12 ----------- app/Models/List/Playlist/PlaylistTrack.php | 12 ----------- app/Models/User/Like.php | 11 ---------- app/Models/User/Submission.php | 2 -- .../User/Submission/SubmissionAnime.php | 14 ------------- .../User/Submission/SubmissionComparison.php | 2 -- app/Models/User/WatchHistory.php | 11 ---------- app/Models/Wiki/Anime.php | 14 ------------- app/Models/Wiki/Anime/AnimeSynonym.php | 11 ---------- app/Models/Wiki/Anime/AnimeTheme.php | 14 ------------- .../Wiki/Anime/Theme/AnimeThemeEntry.php | 14 ------------- app/Models/Wiki/Artist.php | 11 ---------- app/Models/Wiki/Audio.php | 13 ------------ app/Models/Wiki/ExternalResource.php | 11 ---------- app/Models/Wiki/Group.php | 10 --------- app/Models/Wiki/Image.php | 10 --------- app/Models/Wiki/Series.php | 10 --------- app/Models/Wiki/Song.php | 10 --------- app/Models/Wiki/Song/Performance.php | 16 -------------- app/Models/Wiki/Studio.php | 10 --------- app/Models/Wiki/Synonym.php | 12 ----------- app/Models/Wiki/Video.php | 21 ------------------- app/Models/Wiki/Video/VideoScript.php | 10 --------- app/Pivots/Document/PageRole.php | 11 ---------- app/Pivots/Morph/Imageable.php | 12 ----------- app/Pivots/Morph/Resourceable.php | 12 ----------- app/Pivots/Wiki/AnimeSeries.php | 10 --------- app/Pivots/Wiki/AnimeStudio.php | 10 --------- app/Pivots/Wiki/AnimeThemeEntryVideo.php | 10 --------- app/Pivots/Wiki/ArtistMember.php | 14 ------------- app/Providers/AppServiceProvider.php | 2 ++ 42 files changed, 2 insertions(+), 478 deletions(-) diff --git a/app/Models/Admin/ActionLog.php b/app/Models/Admin/ActionLog.php index ca6876d18..3e0e29dc4 100644 --- a/app/Models/Admin/ActionLog.php +++ b/app/Models/Admin/ActionLog.php @@ -73,27 +73,6 @@ class ActionLog extends Model implements Nameable final public const string RELATION_USER = 'user'; final public const string RELATION_TARGET = 'target'; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - ActionLog::ATTRIBUTE_BATCH_ID, - ActionLog::ATTRIBUTE_NAME, - ActionLog::ATTRIBUTE_USER, - ActionLog::ATTRIBUTE_ACTIONABLE_TYPE, - ActionLog::ATTRIBUTE_ACTIONABLE_ID, - ActionLog::ATTRIBUTE_TARGET_TYPE, - ActionLog::ATTRIBUTE_TARGET_ID, - ActionLog::ATTRIBUTE_MODEL_TYPE, - ActionLog::ATTRIBUTE_MODEL_ID, - ActionLog::ATTRIBUTE_FIELDS, - ActionLog::ATTRIBUTE_STATUS, - ActionLog::ATTRIBUTE_EXCEPTION, - ActionLog::ATTRIBUTE_FINISHED_AT, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Admin/Announcement.php b/app/Models/Admin/Announcement.php index ccc355dd5..c92610a35 100644 --- a/app/Models/Admin/Announcement.php +++ b/app/Models/Admin/Announcement.php @@ -53,17 +53,6 @@ class Announcement extends BaseModel implements Auditable 'updated' => AnnouncementUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Announcement::ATTRIBUTE_CONTENT, - Announcement::ATTRIBUTE_END_AT, - Announcement::ATTRIBUTE_START_AT, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Admin/Dump.php b/app/Models/Admin/Dump.php index 0f2d09785..47dfeb776 100644 --- a/app/Models/Admin/Dump.php +++ b/app/Models/Admin/Dump.php @@ -50,16 +50,6 @@ class Dump extends BaseModel 'updated' => DumpUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Dump::ATTRIBUTE_PATH, - Dump::ATTRIBUTE_PUBLIC, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Admin/Feature.php b/app/Models/Admin/Feature.php index 051c24482..b32ddf731 100644 --- a/app/Models/Admin/Feature.php +++ b/app/Models/Admin/Feature.php @@ -49,15 +49,6 @@ class Feature extends BaseModel 'updated' => FeatureUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Feature::ATTRIBUTE_VALUE, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Admin/FeaturedTheme.php b/app/Models/Admin/FeaturedTheme.php index 0ca594b44..08aacbceb 100644 --- a/app/Models/Admin/FeaturedTheme.php +++ b/app/Models/Admin/FeaturedTheme.php @@ -72,19 +72,6 @@ class FeaturedTheme extends BaseModel implements Auditable 'updated' => FeaturedThemeUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - FeaturedTheme::ATTRIBUTE_END_AT, - FeaturedTheme::ATTRIBUTE_ENTRY, - FeaturedTheme::ATTRIBUTE_START_AT, - FeaturedTheme::ATTRIBUTE_USER, - FeaturedTheme::ATTRIBUTE_VIDEO, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Auth/User.php b/app/Models/Auth/User.php index 5fde73f85..bcc5546ae 100644 --- a/app/Models/Auth/User.php +++ b/app/Models/Auth/User.php @@ -127,18 +127,6 @@ class User extends Authenticatable implements Auditable, FilamentUser, HasAvatar 'updated' => UserUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - User::ATTRIBUTE_EMAIL, - User::ATTRIBUTE_NAME, - User::ATTRIBUTE_PASSWORD, - User::ATTRIBUTE_EMAIL_VERIFIED_AT, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Discord/DiscordThread.php b/app/Models/Discord/DiscordThread.php index d9f5b0f50..8757de261 100644 --- a/app/Models/Discord/DiscordThread.php +++ b/app/Models/Discord/DiscordThread.php @@ -51,17 +51,6 @@ class DiscordThread extends BaseModel 'updated' => DiscordThreadUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - DiscordThread::ATTRIBUTE_ANIME, - DiscordThread::ATTRIBUTE_ID, - DiscordThread::ATTRIBUTE_NAME, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Document/Page.php b/app/Models/Document/Page.php index bc668cd40..096bd6e73 100644 --- a/app/Models/Document/Page.php +++ b/app/Models/Document/Page.php @@ -79,19 +79,6 @@ class Page extends BaseModel implements Auditable, SoftDeletable 'updated' => PageUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Page::ATTRIBUTE_BODY, - Page::ATTRIBUTE_NAME, - Page::ATTRIBUTE_NEXT, - Page::ATTRIBUTE_PREVIOUS, - Page::ATTRIBUTE_SLUG, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/List/External/ExternalEntry.php b/app/Models/List/External/ExternalEntry.php index 0869ffaf2..56ef1389b 100644 --- a/app/Models/List/External/ExternalEntry.php +++ b/app/Models/List/External/ExternalEntry.php @@ -43,19 +43,6 @@ class ExternalEntry extends BaseModel final public const string RELATION_PROFILE = 'externalprofile'; final public const string RELATION_USER = 'externalprofile.user'; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - ExternalEntry::ATTRIBUTE_ANIME, - ExternalEntry::ATTRIBUTE_PROFILE, - ExternalEntry::ATTRIBUTE_IS_FAVORITE, - ExternalEntry::ATTRIBUTE_SCORE, - ExternalEntry::ATTRIBUTE_STATUS, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/List/External/ExternalToken.php b/app/Models/List/External/ExternalToken.php index 17a8cb98b..3d7c66a8f 100644 --- a/app/Models/List/External/ExternalToken.php +++ b/app/Models/List/External/ExternalToken.php @@ -47,17 +47,6 @@ class ExternalToken extends BaseModel final public const string RELATION_USER = 'externalprofile.user'; final public const string RELATION_USER_SHALLOW = 'user'; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - ExternalToken::ATTRIBUTE_ACCESS_TOKEN, - ExternalToken::ATTRIBUTE_PROFILE, - ExternalToken::ATTRIBUTE_REFRESH_TOKEN, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/List/ExternalProfile.php b/app/Models/List/ExternalProfile.php index c0fe8e2f9..1b7b665e3 100644 --- a/app/Models/List/ExternalProfile.php +++ b/app/Models/List/ExternalProfile.php @@ -83,20 +83,6 @@ class ExternalProfile extends BaseModel 'updated' => ExternalProfileUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - ExternalProfile::ATTRIBUTE_EXTERNAL_USER_ID, - ExternalProfile::ATTRIBUTE_NAME, - ExternalProfile::ATTRIBUTE_SITE, - ExternalProfile::ATTRIBUTE_SYNCED_AT, - ExternalProfile::ATTRIBUTE_VISIBILITY, - ExternalProfile::ATTRIBUTE_USER, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/List/Playlist.php b/app/Models/List/Playlist.php index 8fa687dfb..59bbe42ae 100644 --- a/app/Models/List/Playlist.php +++ b/app/Models/List/Playlist.php @@ -85,18 +85,6 @@ class Playlist extends BaseModel implements HasAggregateLikes, HasHashids, HasIm 'updated' => PlaylistUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Playlist::ATTRIBUTE_DESCRIPTION, - Playlist::ATTRIBUTE_NAME, - Playlist::ATTRIBUTE_USER, - Playlist::ATTRIBUTE_VISIBILITY, - ]; - /** * Get the route key for the model. * diff --git a/app/Models/List/Playlist/PlaylistTrack.php b/app/Models/List/Playlist/PlaylistTrack.php index 5ba4d5371..74e317c88 100644 --- a/app/Models/List/Playlist/PlaylistTrack.php +++ b/app/Models/List/Playlist/PlaylistTrack.php @@ -80,18 +80,6 @@ class PlaylistTrack extends BaseModel implements HasHashids, InteractsWithSchema 'updated' => TrackUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - PlaylistTrack::ATTRIBUTE_ENTRY, - PlaylistTrack::ATTRIBUTE_PLAYLIST, - PlaylistTrack::ATTRIBUTE_POSITION, - PlaylistTrack::ATTRIBUTE_VIDEO, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/User/Like.php b/app/Models/User/Like.php index 1a4966c29..0d058225a 100644 --- a/app/Models/User/Like.php +++ b/app/Models/User/Like.php @@ -39,17 +39,6 @@ class Like extends BaseModel final public const string RELATION_USER = 'user'; final public const string RELATION_LIKEABLE = 'likeable'; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Like::ATTRIBUTE_USER, - Like::ATTRIBUTE_LIKEABLE_TYPE, - Like::ATTRIBUTE_LIKEABLE_ID, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/User/Submission.php b/app/Models/User/Submission.php index e6be7e186..3de9905d2 100644 --- a/app/Models/User/Submission.php +++ b/app/Models/User/Submission.php @@ -9,7 +9,6 @@ use App\Models\Auth\User; use App\Models\BaseModel; use App\Models\User\Submission\SubmissionComparison; use App\Models\Wiki\Anime; -use Illuminate\Database\Eloquent\Attributes\Guarded; use Illuminate\Database\Eloquent\Attributes\Scope; use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Builder; @@ -37,7 +36,6 @@ use Illuminate\Support\Carbon; * * @method static Builder pending() */ -#[Guarded([])] #[Table(Submission::TABLE, Submission::ATTRIBUTE_ID)] class Submission extends BaseModel { diff --git a/app/Models/User/Submission/SubmissionAnime.php b/app/Models/User/Submission/SubmissionAnime.php index 964c3031b..c7c157097 100644 --- a/app/Models/User/Submission/SubmissionAnime.php +++ b/app/Models/User/Submission/SubmissionAnime.php @@ -15,20 +15,6 @@ class SubmissionAnime extends Anime { use SubmissionModel; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Anime::ATTRIBUTE_NAME, - Anime::ATTRIBUTE_SEASON, - Anime::ATTRIBUTE_SLUG, - Anime::ATTRIBUTE_SYNOPSIS, - Anime::ATTRIBUTE_YEAR, - 'format', - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/User/Submission/SubmissionComparison.php b/app/Models/User/Submission/SubmissionComparison.php index 2bea476eb..6b3405a93 100644 --- a/app/Models/User/Submission/SubmissionComparison.php +++ b/app/Models/User/Submission/SubmissionComparison.php @@ -6,14 +6,12 @@ namespace App\Models\User\Submission; use App\Enums\Models\User\SubmissionComparisonAction; use App\Models\User\Submission; -use Illuminate\Database\Eloquent\Attributes\Guarded; use Illuminate\Database\Eloquent\Attributes\Table; use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphTo; -#[Guarded([])] #[Table(SubmissionComparison::TABLE, SubmissionComparison::ATTRIBUTE_ID)] #[WithoutTimestamps] class SubmissionComparison extends Model diff --git a/app/Models/User/WatchHistory.php b/app/Models/User/WatchHistory.php index 355953c3d..c32ac1ab8 100644 --- a/app/Models/User/WatchHistory.php +++ b/app/Models/User/WatchHistory.php @@ -39,17 +39,6 @@ class WatchHistory extends BaseModel final public const string RELATION_USER = 'user'; final public const string RELATION_VIDEO = 'video'; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - WatchHistory::ATTRIBUTE_ENTRY, - WatchHistory::ATTRIBUTE_USER, - WatchHistory::ATTRIBUTE_VIDEO, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Wiki/Anime.php b/app/Models/Wiki/Anime.php index 2ec842642..ec1e31c0e 100644 --- a/app/Models/Wiki/Anime.php +++ b/app/Models/Wiki/Anime.php @@ -119,20 +119,6 @@ class Anime extends BaseModel implements Auditable, HasImages, HasResources, Has 'updated' => AnimeUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Anime::ATTRIBUTE_NAME, - Anime::ATTRIBUTE_SEASON, - Anime::ATTRIBUTE_SLUG, - Anime::ATTRIBUTE_SYNOPSIS, - Anime::ATTRIBUTE_YEAR, - Anime::ATTRIBUTE_MEDIA_FORMAT, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Wiki/Anime/AnimeSynonym.php b/app/Models/Wiki/Anime/AnimeSynonym.php index 022f9f3c5..56ec8d271 100644 --- a/app/Models/Wiki/Anime/AnimeSynonym.php +++ b/app/Models/Wiki/Anime/AnimeSynonym.php @@ -48,17 +48,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 attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - AnimeSynonym::ATTRIBUTE_ANIME, - AnimeSynonym::ATTRIBUTE_TEXT, - AnimeSynonym::ATTRIBUTE_TYPE, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Wiki/Anime/AnimeTheme.php b/app/Models/Wiki/Anime/AnimeTheme.php index e710aca53..ca035d2e6 100644 --- a/app/Models/Wiki/Anime/AnimeTheme.php +++ b/app/Models/Wiki/Anime/AnimeTheme.php @@ -102,20 +102,6 @@ class AnimeTheme extends BaseModel implements Auditable, InteractsWithSchema, So 'updated' => ThemeUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - AnimeTheme::ATTRIBUTE_ANIME, - AnimeTheme::ATTRIBUTE_GROUP, - AnimeTheme::ATTRIBUTE_SEQUENCE, - AnimeTheme::ATTRIBUTE_SLUG, - AnimeTheme::ATTRIBUTE_SONG, - AnimeTheme::ATTRIBUTE_TYPE, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php b/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php index 4e4bc4575..c63648d4b 100644 --- a/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php +++ b/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php @@ -112,20 +112,6 @@ class AnimeThemeEntry extends BaseModel implements Auditable, HasAggregateLikes, 'updated' => EntryUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - AnimeThemeEntry::ATTRIBUTE_EPISODES, - AnimeThemeEntry::ATTRIBUTE_NOTES, - AnimeThemeEntry::ATTRIBUTE_NSFW, - AnimeThemeEntry::ATTRIBUTE_SPOILER, - AnimeThemeEntry::ATTRIBUTE_THEME, - AnimeThemeEntry::ATTRIBUTE_VERSION, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Wiki/Artist.php b/app/Models/Wiki/Artist.php index a0467f0f1..ff20c4568 100644 --- a/app/Models/Wiki/Artist.php +++ b/app/Models/Wiki/Artist.php @@ -101,17 +101,6 @@ class Artist extends BaseModel implements Auditable, HasImages, HasResources, Ha 'updated' => ArtistUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Artist::ATTRIBUTE_NAME, - Artist::ATTRIBUTE_SLUG, - Artist::ATTRIBUTE_INFORMATION, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Wiki/Audio.php b/app/Models/Wiki/Audio.php index f3a472857..638df4698 100644 --- a/app/Models/Wiki/Audio.php +++ b/app/Models/Wiki/Audio.php @@ -70,19 +70,6 @@ class Audio extends BaseModel implements Auditable, SoftDeletable, Streamable 'updated' => AudioUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Audio::ATTRIBUTE_BASENAME, - Audio::ATTRIBUTE_FILENAME, - Audio::ATTRIBUTE_MIMETYPE, - Audio::ATTRIBUTE_PATH, - Audio::ATTRIBUTE_SIZE, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Wiki/ExternalResource.php b/app/Models/Wiki/ExternalResource.php index 8effd2b73..7a925c4fd 100644 --- a/app/Models/Wiki/ExternalResource.php +++ b/app/Models/Wiki/ExternalResource.php @@ -70,17 +70,6 @@ class ExternalResource extends BaseModel implements Auditable, SoftDeletable 'updated' => ExternalResourceUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - ExternalResource::ATTRIBUTE_EXTERNAL_ID, - ExternalResource::ATTRIBUTE_LINK, - ExternalResource::ATTRIBUTE_SITE, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Wiki/Group.php b/app/Models/Wiki/Group.php index b30c12f2b..501f8bb24 100644 --- a/app/Models/Wiki/Group.php +++ b/app/Models/Wiki/Group.php @@ -59,16 +59,6 @@ class Group extends BaseModel implements Auditable, SoftDeletable 'updated' => GroupUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Group::ATTRIBUTE_NAME, - Group::ATTRIBUTE_SLUG, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Wiki/Image.php b/app/Models/Wiki/Image.php index e0eafaa1c..d876d155d 100644 --- a/app/Models/Wiki/Image.php +++ b/app/Models/Wiki/Image.php @@ -76,16 +76,6 @@ class Image extends BaseModel implements Auditable, SoftDeletable 'updated' => ImageUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Image::ATTRIBUTE_FACET, - Image::ATTRIBUTE_PATH, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Wiki/Series.php b/app/Models/Wiki/Series.php index b0fde868c..0d9b459a2 100644 --- a/app/Models/Wiki/Series.php +++ b/app/Models/Wiki/Series.php @@ -68,16 +68,6 @@ class Series extends BaseModel implements Auditable, SoftDeletable 'updated' => SeriesUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Series::ATTRIBUTE_NAME, - Series::ATTRIBUTE_SLUG, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Wiki/Song.php b/app/Models/Wiki/Song.php index 613b70b8a..0cb018c3a 100644 --- a/app/Models/Wiki/Song.php +++ b/app/Models/Wiki/Song.php @@ -82,16 +82,6 @@ class Song extends BaseModel implements Auditable, HasResources, SoftDeletable 'updated' => SongUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Song::ATTRIBUTE_TITLE, - Song::ATTRIBUTE_TITLE_NATIVE, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Wiki/Song/Performance.php b/app/Models/Wiki/Song/Performance.php index 1e636738b..229abc10c 100644 --- a/app/Models/Wiki/Song/Performance.php +++ b/app/Models/Wiki/Song/Performance.php @@ -79,22 +79,6 @@ class Performance extends BaseModel implements Auditable, SoftDeletable, Sortabl 'updated' => PerformanceUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Performance::ATTRIBUTE_SONG, - Performance::ATTRIBUTE_ARTIST, - Performance::ATTRIBUTE_ALIAS, - Performance::ATTRIBUTE_AS, - Performance::ATTRIBUTE_MEMBER, - Performance::ATTRIBUTE_MEMBER_ALIAS, - Performance::ATTRIBUTE_MEMBER_AS, - Performance::ATTRIBUTE_RELEVANCE, - ]; - public $sortable = [ 'order_column_name' => Performance::ATTRIBUTE_RELEVANCE, ]; diff --git a/app/Models/Wiki/Studio.php b/app/Models/Wiki/Studio.php index d1115835e..33c735219 100644 --- a/app/Models/Wiki/Studio.php +++ b/app/Models/Wiki/Studio.php @@ -74,16 +74,6 @@ class Studio extends BaseModel implements Auditable, HasImages, HasResources, So 'updated' => StudioUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Studio::ATTRIBUTE_NAME, - Studio::ATTRIBUTE_SLUG, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Wiki/Synonym.php b/app/Models/Wiki/Synonym.php index a2667b1b1..235903d17 100644 --- a/app/Models/Wiki/Synonym.php +++ b/app/Models/Wiki/Synonym.php @@ -55,18 +55,6 @@ class Synonym extends BaseModel implements Auditable, SoftDeletable final public const string RELATION_SYNONYMABLE = 'synonymable'; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Synonym::ATTRIBUTE_SYNONYMABLE_TYPE, - Synonym::ATTRIBUTE_SYNONYMABLE_ID, - Synonym::ATTRIBUTE_TEXT, - Synonym::ATTRIBUTE_TYPE, - ]; - /** * The event map for the model. * diff --git a/app/Models/Wiki/Video.php b/app/Models/Wiki/Video.php index 0cb0e14c8..bdf2e62d0 100644 --- a/app/Models/Wiki/Video.php +++ b/app/Models/Wiki/Video.php @@ -124,27 +124,6 @@ class Video extends BaseModel implements Auditable, SoftDeletable, Streamable 'updated' => VideoUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Video::ATTRIBUTE_AUDIO, - Video::ATTRIBUTE_BASENAME, - Video::ATTRIBUTE_FILENAME, - Video::ATTRIBUTE_LYRICS, - Video::ATTRIBUTE_MIMETYPE, - Video::ATTRIBUTE_NC, - Video::ATTRIBUTE_OVERLAP, - Video::ATTRIBUTE_PATH, - Video::ATTRIBUTE_RESOLUTION, - Video::ATTRIBUTE_SIZE, - Video::ATTRIBUTE_SOURCE, - Video::ATTRIBUTE_SUBBED, - Video::ATTRIBUTE_UNCEN, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Models/Wiki/Video/VideoScript.php b/app/Models/Wiki/Video/VideoScript.php index 0122438f4..b2d7331a0 100644 --- a/app/Models/Wiki/Video/VideoScript.php +++ b/app/Models/Wiki/Video/VideoScript.php @@ -65,16 +65,6 @@ class VideoScript extends BaseModel implements Auditable, InteractsWithSchema, S 'updated' => VideoScriptUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - VideoScript::ATTRIBUTE_PATH, - VideoScript::ATTRIBUTE_VIDEO, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Pivots/Document/PageRole.php b/app/Pivots/Document/PageRole.php index 5e095c2d7..41d71e01c 100644 --- a/app/Pivots/Document/PageRole.php +++ b/app/Pivots/Document/PageRole.php @@ -33,17 +33,6 @@ class PageRole extends BasePivot final public const string RELATION_PAGE = 'page'; final public const string RELATION_ROLE = 'role'; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - PageRole::ATTRIBUTE_PAGE, - PageRole::ATTRIBUTE_ROLE, - PageRole::ATTRIBUTE_TYPE, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Pivots/Morph/Imageable.php b/app/Pivots/Morph/Imageable.php index 7015320b4..d1535673c 100644 --- a/app/Pivots/Morph/Imageable.php +++ b/app/Pivots/Morph/Imageable.php @@ -73,18 +73,6 @@ class Imageable extends BaseMorphPivot implements Auditable 'updated' => ImageableUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Imageable::ATTRIBUTE_DEPTH, - Imageable::ATTRIBUTE_IMAGE, - Imageable::ATTRIBUTE_IMAGEABLE_TYPE, - Imageable::ATTRIBUTE_IMAGEABLE_ID, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Pivots/Morph/Resourceable.php b/app/Pivots/Morph/Resourceable.php index 3e0517399..4b99895c0 100644 --- a/app/Pivots/Morph/Resourceable.php +++ b/app/Pivots/Morph/Resourceable.php @@ -75,18 +75,6 @@ class Resourceable extends BaseMorphPivot implements Auditable 'updated' => ResourceableUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - Resourceable::ATTRIBUTE_AS, - Resourceable::ATTRIBUTE_RESOURCE, - Resourceable::ATTRIBUTE_RESOURCEABLE_TYPE, - Resourceable::ATTRIBUTE_RESOURCEABLE_ID, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Pivots/Wiki/AnimeSeries.php b/app/Pivots/Wiki/AnimeSeries.php index 96f82b734..18ac2b4cc 100644 --- a/app/Pivots/Wiki/AnimeSeries.php +++ b/app/Pivots/Wiki/AnimeSeries.php @@ -48,16 +48,6 @@ class AnimeSeries extends BasePivot implements Auditable 'deleted' => AnimeSeriesDeleted::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - AnimeSeries::ATTRIBUTE_ANIME, - AnimeSeries::ATTRIBUTE_SERIES, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Pivots/Wiki/AnimeStudio.php b/app/Pivots/Wiki/AnimeStudio.php index 097cdb3be..b2abc5c8a 100644 --- a/app/Pivots/Wiki/AnimeStudio.php +++ b/app/Pivots/Wiki/AnimeStudio.php @@ -48,16 +48,6 @@ class AnimeStudio extends BasePivot implements Auditable 'deleted' => AnimeStudioDeleted::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - AnimeStudio::ATTRIBUTE_ANIME, - AnimeStudio::ATTRIBUTE_STUDIO, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Pivots/Wiki/AnimeThemeEntryVideo.php b/app/Pivots/Wiki/AnimeThemeEntryVideo.php index d37ba205f..be6c4853d 100644 --- a/app/Pivots/Wiki/AnimeThemeEntryVideo.php +++ b/app/Pivots/Wiki/AnimeThemeEntryVideo.php @@ -52,16 +52,6 @@ class AnimeThemeEntryVideo extends BasePivot implements Auditable 'deleted' => AnimeThemeEntryVideoDeleted::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - AnimeThemeEntryVideo::ATTRIBUTE_ENTRY, - AnimeThemeEntryVideo::ATTRIBUTE_VIDEO, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Pivots/Wiki/ArtistMember.php b/app/Pivots/Wiki/ArtistMember.php index 87090f35e..22e0f4948 100644 --- a/app/Pivots/Wiki/ArtistMember.php +++ b/app/Pivots/Wiki/ArtistMember.php @@ -57,20 +57,6 @@ class ArtistMember extends BasePivot implements Auditable 'updated' => ArtistMemberUpdated::class, ]; - /** - * The attributes that are mass assignable. - * - * @var list - */ - protected $fillable = [ - ArtistMember::ATTRIBUTE_ALIAS, - ArtistMember::ATTRIBUTE_ARTIST, - ArtistMember::ATTRIBUTE_AS, - ArtistMember::ATTRIBUTE_MEMBER, - ArtistMember::ATTRIBUTE_NOTES, - ArtistMember::ATTRIBUTE_RELEVANCE, - ]; - /** * Get the attributes that should be cast. * diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 9958f5cd0..d9449e80b 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -83,6 +83,8 @@ class AppServiceProvider extends ServiceProvider { Model::automaticallyEagerLoadRelationships(); + Model::unguard(); + Model::preventLazyLoading(); Model::handleLazyLoadingViolationUsing(function (Model $model, string $relation): void {