File tree 1 file changed +17
-0
lines changed 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 8
8
use Hyde \RealtimeCompiler \Actions \AssetFileLocator ;
9
9
use Hyde \RealtimeCompiler \Concerns \SendsErrorResponses ;
10
10
use Hyde \RealtimeCompiler \Models \FileObject ;
11
+ use Hyde \RealtimeCompiler \Concerns \InteractsWithLaravel ;
12
+ use Hyde \Framework \Actions \GeneratesDocumentationSearchIndex ;
11
13
12
14
class Router
13
15
{
14
16
use SendsErrorResponses;
17
+ use InteractsWithLaravel;
15
18
16
19
protected Request $ request ;
17
20
@@ -71,6 +74,10 @@ protected function shouldProxy(Request $request): bool
71
74
*/
72
75
protected function proxyStatic (): Response
73
76
{
77
+ if ($ this ->request ->path === '/docs/search.json ' ) {
78
+ $ this ->generateSearchIndex ();
79
+ }
80
+
74
81
$ path = AssetFileLocator::find ($ this ->request ->path );
75
82
76
83
if ($ path === null ) {
@@ -86,4 +93,14 @@ protected function proxyStatic(): Response
86
93
'Content-Length ' => $ file ->getContentLength (),
87
94
]);
88
95
}
96
+
97
+ /**
98
+ * Generate the documentation search index.
99
+ */
100
+ protected function generateSearchIndex (): void
101
+ {
102
+ $ this ->bootApplication ();
103
+
104
+ GeneratesDocumentationSearchIndex::handle ();
105
+ }
89
106
}
You can’t perform that action at this time.
0 commit comments