hasMany(Design::class); } public function coverUrl(bool $preview = false): ?string { if (! $this->cover) { return null; } if (! str_starts_with($this->cover, self::COVER_DIRECTORY.'/')) { return asset($this->cover); } return route($preview ? 'studio.collection-cover' : 'collection.cover', [ 'id' => $this->id, 'file' => basename($this->cover), ]); } }