Skip to content

Commit

Permalink
add str replace for external_laravel with theme "elements" (#906)
Browse files Browse the repository at this point in the history
* add str replace for external_laravel with elements-theme

* Update src/Writing/Writer.php

Co-authored-by: Shalvah <[email protected]>

---------

Co-authored-by: Shalvah <[email protected]>
  • Loading branch information
cleeimpro and shalvah authored Nov 5, 2024
1 parent 6837c03 commit 80f2a6d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Writing/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ protected function performFinalTasksForLaravelType(): void
$contents = str_replace('href="../docs/collection.json"', 'href="{{ route("' . $this->paths->outputPath('postman', '.') . '") }}"', $contents);
$contents = str_replace('href="../docs/openapi.yaml"', 'href="{{ route("' . $this->paths->outputPath('openapi', '.') . '") }}"', $contents);
$contents = str_replace('url="../docs/openapi.yaml"', 'url="{{ route("' . $this->paths->outputPath('openapi', '.') . '") }}"', $contents);
// With Elements theme, we'd have <elements-api apiDescriptionUrl="../docs/openapi.yaml"
$contents = str_replace('Url="../docs/openapi.yaml"', 'Url="{{ route("' . $this->paths->outputPath('openapi', '.') . '") }}"', $contents);

file_put_contents("$this->laravelTypeOutputPath/index.blade.php", $contents);
}
Expand Down

0 comments on commit 80f2a6d

Please sign in to comment.