Skip to content

Commit 8f48d8a

Browse files
committed
Add property to stub + move rootView method up
1 parent 3658cce commit 8f48d8a

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

src/Middleware.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ public function share(Request $request)
4949
];
5050
}
5151

52+
/**
53+
* Sets the root template that will be loaded on the first page visit.
54+
*
55+
* @see https://inertiajs.com/server-side-setup#root-template
56+
* @param Request $request
57+
* @return string
58+
*/
59+
public function rootView(Request $request)
60+
{
61+
return $this->rootView;
62+
}
63+
5264
/**
5365
* Handle the incoming request.
5466
*
@@ -138,16 +150,4 @@ public function resolveValidationErrors(Request $request)
138150
return $bags->has('default') ? $bags->get('default') : $bags->toArray();
139151
});
140152
}
141-
142-
/**
143-
* Sets the root template that will be loaded on the first page visit.
144-
*
145-
* @see https://inertiajs.com/server-side-setup#root-template
146-
* @param Request $request
147-
* @return string
148-
*/
149-
public function rootView(Request $request)
150-
{
151-
return $this->rootView;
152-
}
153153
}

stubs/middleware.stub

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ use Inertia\Middleware;
77

88
class {{ class }} extends Middleware
99
{
10+
/**
11+
* The root template that will be loaded on the first page visit.
12+
*
13+
* @var string
14+
*/
15+
protected $rootView = 'app';
16+
1017
/**
1118
* Determines the current asset version.
1219
*

0 commit comments

Comments
 (0)