hasMany(Post::class); } public function getUrlAttribute(): string { return route('category.show', $this->slug ?? $this->id); } public function registerMediaCollections(): void { $this->addMediaCollection('cover') ->useDisk(\App\Support\MediaDisk::name()) ->singleFile(); } }