getPathAttribute()); }); } public function account() { return $this->belongsTo(Account::class); } 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; } }