File tree Expand file tree Collapse file tree 5 files changed +26
-7
lines changed
resources/views/components Expand file tree Collapse file tree 5 files changed +26
-7
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace App \Enums ;
4+
5+ enum Version: string
6+ {
7+ case Four = '4.x ' ;
8+ case Three = '3.x ' ;
9+ case Two = '2.x ' ;
10+ case One = '1.x ' ;
11+
12+ public static function getLatest (): self
13+ {
14+ return self ::Four;
15+ }
16+ }
Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ class="absolute inset-0 -z-10 h-full w-full rounded-full bg-[#8e7edd] transition
235235 </a >
236236 <a
237237 x-ref =" how_to_make_plugins"
238- href =" /docs/support/ plugins/getting-started"
238+ href =" /docs/plugins/getting-started"
239239 class =" group/button relative block"
240240 >
241241 {{-- Button --}}
Original file line number Diff line number Diff line change @@ -384,7 +384,7 @@ class="mx-auto max-w-md px-4 pt-2 text-dolphin"
384384 class =" px-4 pt-10"
385385 >
386386 <a
387- href =" {{ route (' docs' , [' slug' => ' panels/getting-started ' ]) } }"
387+ href =" {{ route (' docs' , [' slug' => ' introduction/overview ' ]) } }"
388388 class =" group/getstarted relative flex w-full items-center justify-between gap-5 overflow-hidden rounded-2xl px-10 py-8 ring-2 ring-transparent transition duration-300 hover:ring-peach-orange/40 motion-reduce:transition-none sm:py-10"
389389 >
390390 <div class =" text-2xl font-bold sm:text-3xl" >
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ class="pt-5 text-xl text-dolphin"
5858 {{-- Link --}}
5959 <div class =" grid place-items-center pt-10" >
6060 <a
61- href =" {{ route (' docs' , [' slug' => ' panels/getting-started ' ]) } }"
61+ href =" {{ route (' docs' , [' slug' => ' introduction/overview ' ]) } }"
6262 class =" rounded-full bg-[#ffbc74] px-7 py-3 text-white transition duration-300 hover:bg-[#ffbc74]/80"
6363 >
6464 Get Started
Original file line number Diff line number Diff line change 11<?php
22
3+ use App \Enums \Version ;
34use App \Http \Controllers ;
45use App \Models \Article ;
56use App \Models \Plugin ;
5455
5556Route::redirect ('/discord ' , 'https://discord.gg/filament ' )->name ('discord ' );
5657
57- Route::get ('/api/{version?} ' , function (string $ version = '4.x ' ): RedirectResponse {
58- return redirect ('/api/ ' . $ version . '/index.html ' );
59- })->where ('version ' , '[1-4]+\.x ' )->name ('api-docs ' );
58+ Route::get ('/api/{version?} ' , function (?Version $ version = null ): RedirectResponse {
59+ $ version = $ version ?? Version::getLatest ();
60+
61+ return redirect ('/api/ ' . $ version ->value . '/index.html ' );
62+ })->name ('api-docs ' );
6063
6164Route::prefix ('/docs ' )->group (function () {
6265 Route::get ('/{slug?} ' , function (string $ slug = null ): string | RedirectResponse {
7477 $ slug = trim ($ slug , '/ ' );
7578
7679 if (filled ($ slug ) && (! str_contains ($ slug , '.x ' ))) {
77- return redirect ()->route ('docs ' , ['slug ' => " 4.x / {$ slug }" ]);
80+ return redirect ()->route ('docs ' , ['slug ' => Version:: getLatest ()-> value . " / {$ slug }" ]);
7881 }
7982
8083 $ filePath = base_path ("docs/preserved-dist/ {$ slug }/index.html " );
You can’t perform that action at this time.
0 commit comments