'datetime', ]; protected static function booted() { static::deleting(function ($category) { Storage::delete($this->getPathAttribute()); }); } public function account() { return $this->belongsTo(Account::class)->withoutGlobalScopes(); } public function getMaxUploadSizeAttribute(): ?int { return maxUploadSize(); } public function getUploadUrlAttribute(): ?string { return route('file.upload', $this->attributes['id']); } public function getPathAttribute(): string { return self::FILES_PATH . '/' . $this->attributes['name']; } public function getDownloadUrlAttribute(): ?string { return !empty($this->attributes['name']) && !empty($this->attributes['id']) ? route('file.show', [$this->attributes['id'], $this->attributes['name']]) : null; } }