$accountLog * @property-read int|null $account_log_count * @property-read Collection $clients * @property-read int|null $clients_count * @property-read Collection $devices * @property-read int|null $devices_count * @property-read Collection $filters * @property-read int|null $filters_count * @property-read mixed $max_collections_per_day * @property-read mixed $max_collections_per_hour * @property-read mixed $max_collections_per_month * @property-read mixed $max_comments_per_day * @property-read mixed $max_comments_per_hour * @property-read mixed $max_compose_media_updates_per_day * @property-read mixed $max_compose_media_updates_per_hour * @property-read mixed $max_compose_media_updates_per_month * @property-read mixed $max_hashtag_follows_per_day * @property-read mixed $max_hashtag_follows_per_hour * @property-read mixed $max_instance_bans_per_day * @property-read int $max_likes_per_day * @property-read int $max_likes_per_hour * @property-read mixed $max_post_edits_per_day * @property-read mixed $max_post_edits_per_hour * @property-read mixed $max_posts_per_day * @property-read mixed $max_posts_per_hour * @property-read mixed $max_shares_per_day * @property-read mixed $max_shares_per_hour * @property-read mixed $max_stories_per_day * @property-read mixed $max_stories_per_hour * @property-read mixed $max_story_delete_per_day * @property-read mixed $max_user_bans_per_day * @property-read Collection $interstitials * @property-read int|null $interstitials_count * @property-read DatabaseNotificationCollection $notifications * @property-read int|null $notifications_count * @property-read Collection $oauthApps * @property-read int|null $oauth_apps_count * @property-read Profile|null $profile * @property-read Collection $pushSubscriptions * @property-read int|null $push_subscriptions_count * @property-read UserSetting|null $settings * @property-read Collection $statuses * @property-read int|null $statuses_count * @property-read Collection $tokens * @property-read int|null $tokens_count * * @method static \Database\Factories\UserFactory factory($count = null, $state = []) * @method static \Illuminate\Database\Eloquent\Builder|User newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|User newQuery() * @method static \Illuminate\Database\Eloquent\Builder|User onlyTrashed() * @method static \Illuminate\Database\Eloquent\Builder|User query() * @method static \Illuminate\Database\Eloquent\Builder|User where2faBackupCodes($value) * @method static \Illuminate\Database\Eloquent\Builder|User where2faEnabled($value) * @method static \Illuminate\Database\Eloquent\Builder|User where2faSecret($value) * @method static \Illuminate\Database\Eloquent\Builder|User where2faSetupAt($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereAppRegisterIp($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereAppRegisterToken($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereDeleteAfter($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereDeletedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereDomain($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereEmail($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereEmailVerifiedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereExpoToken($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereGuid($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereHasInterstitial($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereHasRoles($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereIsAdmin($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereLanguage($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereLastActiveAt($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereName($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereNotifyEnabled($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereParentId($value) * @method static \Illuminate\Database\Eloquent\Builder|User wherePassword($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereProfileId($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereRegisterSource($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereRememberToken($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereRoleId($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereStatus($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereStorageUsed($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereStorageUsedUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereUsername($value) * @method static \Illuminate\Database\Eloquent\Builder|User withTrashed(bool $withTrashed = true) * @method static \Illuminate\Database\Eloquent\Builder|User withoutTrashed() * * @mixin \Eloquent */ class User extends Authenticatable implements OAuthenticatable { use HasApiTokens, HasFactory, HasPushSubscriptions, Notifiable, SoftDeletes, UserRateLimit; protected function casts(): array { return [ 'is_admin' => 'boolean', 'deleted_at' => 'datetime', 'email_verified_at' => 'datetime', '2fa_setup_at' => 'datetime', 'last_active_at' => 'datetime', 'storage_used_updated_at' => 'datetime', ]; } /** * The attributes that are mass assignable. * * @var array */ protected $guarded = []; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'email', 'password', 'is_admin', 'remember_token', 'email_verified_at', '2fa_enabled', '2fa_secret', '2fa_backup_codes', '2fa_setup_at', 'deleted_at', 'updated_at', ]; public function profile(): HasOne { return $this->hasOne(Profile::class); } public function url() { return url(config('app.url').'/'.$this->username); } public function settings() { return $this->hasOne(UserSetting::class); } public function statuses() { return $this->hasManyThrough( Status::class, Profile::class ); } public function filters() { return $this->hasMany(UserFilter::class, 'user_id', 'profile_id'); } public function receivesBroadcastNotificationsOn(): string { return 'App.User.'.$this->id; } public function devices() { return $this->hasMany(UserDevice::class); } public function storageUsedKey(): string { return 'profile:storage:used:'.$this->id; } public function accountLog() { return $this->hasMany(AccountLog::class); } public function interstitials() { return $this->hasMany(AccountInterstitial::class); } public function avatarUrl() { if (! $this->profile_id || $this->status) { return config('app.url').'/storage/avatars/default.jpg'; } return AvatarService::get($this->profile_id); } public function routeNotificationForExpo() { return $this->expo_token; } }