'integer', 'downloads' => 'integer', 'synced_at' => 'datetime', ]; } public function article(): BelongsTo { return $this->belongsTo(Article::class); } protected static function booted(): void { static::deleting(function (Attachment $attachment): void { app(AttachmentStorageService::class)->deleteFromDisk($attachment); }); } public function scopePubliclyVisible(Builder $query): Builder { return $query->where('visibility', self::VISIBILITY_PUBLIC); } }