path = Str::start(Str::finish($this->path, '/'), '/'); } /** * Store all files of the bundle */ public function save() { $this->saveMetadata(); $this->saveMarkdown(); } /** * Gte a complete filename prefixed with bundle's path */ private function getFilenameInBundle(string $filename, ?string $extension = null) { $filename = Str::remove($this->path, $filename); if (!empty($extension) && !Str::endsWith($filename, $extension)) { $filename .= $extension; } return sprintf('%s%s', $this->path, $filename); } /** * Return a boolean value indicating if there already is a bundle in * specified path */ public function exists() { return $this->markdown()->exists(); } }