diff --git a/app/AccountLog.php b/app/AccountLog.php index 733a93045..3740e71dc 100644 --- a/app/AccountLog.php +++ b/app/AccountLog.php @@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model; class AccountLog extends Model { - protected $fillable = ['*']; + protected $guarded = []; public function user() { diff --git a/app/Activity.php b/app/Activity.php index a9aea33d1..b07360783 100644 --- a/app/Activity.php +++ b/app/Activity.php @@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model; class Activity extends Model { - protected $fillable = ['data', 'to_id', 'from_id', 'object_type']; + protected $guarded = []; protected function casts(): array { diff --git a/app/Bookmark.php b/app/Bookmark.php index 20907c6e7..fa3282742 100644 --- a/app/Bookmark.php +++ b/app/Bookmark.php @@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model; class Bookmark extends Model { - protected $fillable = ['profile_id', 'status_id']; + protected $guarded = []; public function status() { diff --git a/app/Circle.php b/app/Circle.php index 3068605b8..b7964d3b9 100644 --- a/app/Circle.php +++ b/app/Circle.php @@ -6,14 +6,7 @@ use Illuminate\Database\Eloquent\Model; class Circle extends Model { - protected $fillable = [ - 'profile_id', - 'name', - 'description', - 'bcc', - 'scope', - 'active', - ]; + protected $guarded = []; public function members() { diff --git a/app/CircleProfile.php b/app/CircleProfile.php index 98e5b6f0a..5faed0e61 100644 --- a/app/CircleProfile.php +++ b/app/CircleProfile.php @@ -6,8 +6,5 @@ use Illuminate\Database\Eloquent\Model; class CircleProfile extends Model { - protected $fillable = [ - 'circle_id', - 'profile_id', - ]; + protected $guarded = []; } diff --git a/app/DiscoverCategory.php b/app/DiscoverCategory.php index 9cdfc370c..d46ff30d3 100644 --- a/app/DiscoverCategory.php +++ b/app/DiscoverCategory.php @@ -3,18 +3,19 @@ namespace App; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Carbon; /** * @property int $id * @property string $slug * @property int|null $media_id - * @property \Illuminate\Support\Carbon|null $created_at - * @property \Illuminate\Support\Carbon|null $updated_at - * @property-read \App\Media|null $media + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property-read Media|null $media */ class DiscoverCategory extends Model { - protected $fillable = ['slug']; + protected $guarded = []; public function media() { diff --git a/app/DiscoverCategoryHashtag.php b/app/DiscoverCategoryHashtag.php index ad3a14f7f..4810d80d0 100644 --- a/app/DiscoverCategoryHashtag.php +++ b/app/DiscoverCategoryHashtag.php @@ -6,8 +6,5 @@ use Illuminate\Database\Eloquent\Model; class DiscoverCategoryHashtag extends Model { - protected $fillable = [ - 'discover_category_id', - 'hashtag_id', - ]; + protected $guarded = []; } diff --git a/app/FollowRequest.php b/app/FollowRequest.php index a8c0302e1..1997efb75 100644 --- a/app/FollowRequest.php +++ b/app/FollowRequest.php @@ -3,23 +3,24 @@ namespace App; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Carbon; /** * @property int $id * @property int $follower_id * @property int $following_id * @property array|null $activity - * @property \Illuminate\Support\Carbon|null $handled_at - * @property \Illuminate\Support\Carbon|null $created_at - * @property \Illuminate\Support\Carbon|null $updated_at - * @property-read \App\Profile $target - * @property-read \App\Profile $actor - * @property-read \App\Profile $follower - * @property-read \App\Profile $following + * @property Carbon|null $handled_at + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property-read Profile $target + * @property-read Profile $actor + * @property-read Profile $follower + * @property-read Profile $following */ class FollowRequest extends Model { - protected $fillable = ['follower_id', 'following_id', 'activity', 'handled_at']; + protected $guarded = []; protected function casts(): array { diff --git a/app/Follower.php b/app/Follower.php index 35d00eb5a..93e2aaef3 100644 --- a/app/Follower.php +++ b/app/Follower.php @@ -3,21 +3,22 @@ namespace App; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Carbon; /** * @property int $id * @property int $profile_id * @property int $following_id * @property bool|null $local_profile - * @property \Illuminate\Support\Carbon|null $created_at - * @property \Illuminate\Support\Carbon|null $updated_at - * @property-read \App\Profile $actor - * @property-read \App\Profile $target - * @property-read \App\Profile $profile + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property-read Profile $actor + * @property-read Profile $target + * @property-read Profile $profile */ class Follower extends Model { - protected $fillable = ['profile_id', 'following_id', 'local_profile']; + protected $guarded = []; const MAX_FOLLOWING = 7500; diff --git a/app/HashtagFollow.php b/app/HashtagFollow.php index dbed4650b..a871625a2 100644 --- a/app/HashtagFollow.php +++ b/app/HashtagFollow.php @@ -7,11 +7,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; class HashtagFollow extends Model { - protected $fillable = [ - 'user_id', - 'profile_id', - 'hashtag_id', - ]; + protected $guarded = []; const MAX_LIMIT = 25; diff --git a/app/Instance.php b/app/Instance.php index a86312be4..637ee9776 100644 --- a/app/Instance.php +++ b/app/Instance.php @@ -6,13 +6,7 @@ use Illuminate\Database\Eloquent\Model; class Instance extends Model { - protected $fillable = [ - 'domain', - 'banned', - 'auto_cw', - 'unlisted', - 'notes', - ]; + protected $guarded = []; protected function casts(): array { diff --git a/app/ModLog.php b/app/ModLog.php index b60859742..12e485512 100644 --- a/app/ModLog.php +++ b/app/ModLog.php @@ -8,7 +8,7 @@ class ModLog extends Model { protected $visible = ['id']; - protected $fillable = ['*']; + protected $guarded = []; public function admin() { diff --git a/app/Models/AdminInvite.php b/app/Models/AdminInvite.php index 2101be5d5..f74a78fde 100644 --- a/app/Models/AdminInvite.php +++ b/app/Models/AdminInvite.php @@ -7,16 +7,7 @@ use Illuminate\Support\Str; class AdminInvite extends Model { - protected $fillable = [ - 'name', - 'description', - 'message', - 'max_uses', - 'uses', - 'skip_email_verification', - 'expires_at', - 'admin_user_id', - ]; + protected $guarded = []; protected function casts(): array { diff --git a/app/Models/Conversation.php b/app/Models/Conversation.php index 5b06c1c01..efe5512aa 100644 --- a/app/Models/Conversation.php +++ b/app/Models/Conversation.php @@ -9,5 +9,5 @@ class Conversation extends Model { use HasFactory; - protected $fillable = ['from_id', 'to_id']; + protected $guarded = []; } diff --git a/app/Models/CuratedRegisterTemplate.php b/app/Models/CuratedRegisterTemplate.php index c0505ebe0..31093e4d1 100644 --- a/app/Models/CuratedRegisterTemplate.php +++ b/app/Models/CuratedRegisterTemplate.php @@ -9,9 +9,7 @@ class CuratedRegisterTemplate extends Model { use HasFactory; - protected $fillable = [ - 'name', 'description', 'content', 'is_active', 'order', - ]; + protected $guarded = []; protected function casts(): array { diff --git a/app/Models/CustomFilterKeyword.php b/app/Models/CustomFilterKeyword.php index c7a5e7dff..aeac7f0a0 100644 --- a/app/Models/CustomFilterKeyword.php +++ b/app/Models/CustomFilterKeyword.php @@ -7,9 +7,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; class CustomFilterKeyword extends Model { - protected $fillable = [ - 'keyword', 'whole_word', 'custom_filter_id', - ]; + protected $guarded = []; protected function casts(): array { diff --git a/app/Models/CustomFilterStatus.php b/app/Models/CustomFilterStatus.php index 44084a6e7..aaa8813e4 100644 --- a/app/Models/CustomFilterStatus.php +++ b/app/Models/CustomFilterStatus.php @@ -7,9 +7,7 @@ use Illuminate\Database\Eloquent\Model; class CustomFilterStatus extends Model { - protected $fillable = [ - 'custom_filter_id', 'status_id', - ]; + protected $guarded = []; public function customFilter() { diff --git a/app/Models/GroupLimit.php b/app/Models/GroupLimit.php index 682280b40..832996fac 100644 --- a/app/Models/GroupLimit.php +++ b/app/Models/GroupLimit.php @@ -9,10 +9,7 @@ class GroupLimit extends Model { use HasFactory; - protected $fillable = [ - 'profile_id', - 'group_id', - ]; + protected $guarded = []; protected function casts(): array { diff --git a/app/Models/GroupPost.php b/app/Models/GroupPost.php index 603cb1be6..411a8486c 100644 --- a/app/Models/GroupPost.php +++ b/app/Models/GroupPost.php @@ -19,15 +19,7 @@ class GroupPost extends Model */ public $incrementing = false; - protected $fillable = [ - 'remote_url', - 'group_id', - 'profile_id', - 'type', - 'caption', - 'visibility', - 'is_nsfw', - ]; + protected $guarded = []; public function mediaPath() { diff --git a/app/Models/UserOidcMapping.php b/app/Models/UserOidcMapping.php index 13129d6b9..a942d470d 100644 --- a/app/Models/UserOidcMapping.php +++ b/app/Models/UserOidcMapping.php @@ -12,10 +12,7 @@ class UserOidcMapping extends Model public $timestamps = true; - protected $fillable = [ - 'user_id', - 'oidc_id', - ]; + protected $guarded = []; public function user() { diff --git a/app/Newsroom.php b/app/Newsroom.php index 88178c9ad..fe5056841 100644 --- a/app/Newsroom.php +++ b/app/Newsroom.php @@ -8,7 +8,7 @@ class Newsroom extends Model { protected $table = 'newsroom'; - protected $fillable = ['title']; + protected $guarded = []; protected function casts(): array { diff --git a/app/Page.php b/app/Page.php index 9e550f543..bcc02f6cd 100644 --- a/app/Page.php +++ b/app/Page.php @@ -11,7 +11,7 @@ class Page extends Model 'page', ]; - protected $fillable = ['slug']; + protected $guarded = []; public function url() { diff --git a/app/StatusView.php b/app/StatusView.php index 9f53a20c2..73b71f6c8 100644 --- a/app/StatusView.php +++ b/app/StatusView.php @@ -9,9 +9,5 @@ class StatusView extends Model { use HasFactory; - protected $fillable = [ - 'status_id', - 'status_profile_id', - 'profile_id', - ]; + protected $guarded = []; } diff --git a/app/Story.php b/app/Story.php index 77d966716..dc22b308f 100644 --- a/app/Story.php +++ b/app/Story.php @@ -34,7 +34,7 @@ class Story extends Model */ public $incrementing = false; - protected $fillable = ['profile_id', 'view_count']; + protected $guarded = []; protected $visible = ['id']; diff --git a/app/UIKit.php b/app/UIKit.php index fcdd32e0b..fab92f251 100644 --- a/app/UIKit.php +++ b/app/UIKit.php @@ -8,12 +8,7 @@ class UIKit extends Model { protected $table = 'uikit'; - protected $fillable = [ - 'k', - 'v', - 'defv', - 'dhis', - ]; + protected $guarded = []; public static function section($k) { diff --git a/app/UserDevice.php b/app/UserDevice.php index 22225e339..99e2a30f6 100644 --- a/app/UserDevice.php +++ b/app/UserDevice.php @@ -2,16 +2,12 @@ namespace App; -use Illuminate\Database\Eloquent\Model; use App\Services\UserAgentService; +use Illuminate\Database\Eloquent\Model; class UserDevice extends Model { - protected $fillable = [ - 'user_id', - 'ip', - 'user_agent', - ]; + protected $guarded = []; public $timestamps = [ 'last_active_at', diff --git a/app/UserFilter.php b/app/UserFilter.php index 15664f1cc..260aeba3b 100644 --- a/app/UserFilter.php +++ b/app/UserFilter.php @@ -6,17 +6,12 @@ use Illuminate\Database\Eloquent\Model; class UserFilter extends Model { - protected $fillable = [ - 'user_id', - 'filterable_id', - 'filterable_type', - 'filter_type', - ]; + protected $guarded = []; public function mutedUserIds($profile_id) { return $this->whereUserId($profile_id) - ->whereFilterableType(\App\Profile::class) + ->whereFilterableType(Profile::class) ->whereFilterType('mute') ->pluck('filterable_id'); } @@ -24,7 +19,7 @@ class UserFilter extends Model public function blockedUserIds($profile_id) { return $this->whereUserId($profile_id) - ->whereFilterableType(\App\Profile::class) + ->whereFilterableType(Profile::class) ->whereFilterType('block') ->pluck('filterable_id'); } diff --git a/app/UserSetting.php b/app/UserSetting.php index 91744eafb..bba0c46b4 100644 --- a/app/UserSetting.php +++ b/app/UserSetting.php @@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model; class UserSetting extends Model { - protected $fillable = ['user_id']; + protected $guarded = []; protected function casts(): array {