We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33c47eb commit 11a9682Copy full SHA for 11a9682
app/Livewire/VersionSwitcher.php
@@ -31,10 +31,19 @@ public function mount(array $versions)
31
32
public function updatedVersion()
33
{
34
+ if (! $this->pageExists($this->platform, $this->version, $this->page)) {
35
+ $this->page = 'introduction';
36
+ }
37
+
38
return redirect()->route('docs.show', [
39
'platform' => $this->platform,
40
'version' => $this->version,
41
'page' => $this->page,
42
]);
43
}
44
45
+ protected function pageExists(string $platform, int $version, string $page): bool
46
+ {
47
+ return file_exists(resource_path("views/docs/{$platform}/{$version}/{$page}.md"));
48
49
0 commit comments