File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -330,11 +330,26 @@ public static function redirect(
330330 *
331331 * @param string $pattern The route pattern/path to match
332332 * @param string $view The view to render
333+ * @param array $data The data to pass to the view
333334 */
334- public static function view (string $ pattern , string $ view )
335+ public static function view (string $ pattern , string $ view, $ data = [] )
335336 {
336- static ::get ($ pattern , function () use ($ view ) {
337- return response ()->view ($ view );
337+ static ::get ($ pattern , function () use ($ view , $ data ) {
338+ return response ()->view ($ view , $ data );
339+ });
340+ }
341+
342+ /**
343+ * Add a route that renders an inertia view
344+ *
345+ * @param string $pattern The route pattern/path to match
346+ * @param string $view The view to render
347+ * @param array $data The data to pass to the view
348+ */
349+ public static function inertia (string $ pattern , string $ view , $ data = [])
350+ {
351+ static ::get ($ pattern , function () use ($ view , $ data ) {
352+ return inertia ($ view , $ data );
338353 });
339354 }
340355
You can’t perform that action at this time.
0 commit comments