@@ -140,6 +140,9 @@ public function __construct()
140140 {
141141 $ this ->username = Fortify::username ();
142142 $ this ->email = Fortify::email ();
143+
144+ $ this ->cachedConfig = config ('fortify ' , []);
145+ $ this ->cachedOptionsConfig = config ('fortify-options ' , []);
143146 }
144147
145148 /**
@@ -150,13 +153,8 @@ public function __construct()
150153 */
151154 public function features (Closure |array |null $ features = null )
152155 {
153- $ this ->cachedConfig = config ('fortify ' , []);
154- $ this ->cachedOptionsConfig = config ('fortify-options ' , []);
155-
156156 if (! \is_null ($ features )) {
157- $ this ->features = collect (Arr::wrap (value ($ features )))->merge (array_filter ([
158- Nova::routes ()->withPasswordReset ? Features::resetPasswords () : null ,
159- ]))->unique ()->all ();
157+ $ this ->features = Arr::wrap (value ($ features ));
160158
161159 $ this ->options = config ('fortify-options ' );
162160 }
@@ -328,10 +326,12 @@ public function flush(): void
328326 public function register (?bool $ routes = null ): void
329327 {
330328 if (\is_null ($ routes )) {
331- $ routes = Util::isFortifyRoutesRegisteredForFrontend ();
329+ $ routes = Fortify::$ registersRoutes === true
330+ ? Util::isFortifyRoutesRegisteredForFrontend ()
331+ : false ;
332332 }
333333
334- if ($ routes === false ) {
334+ if ($ routes === false && Fortify:: $ registersRoutes === true ) {
335335 Fortify::ignoreRoutes ();
336336 }
337337
@@ -346,6 +346,11 @@ public function bootstrap(): void
346346 /** @var \Laravel\Nova\PendingRouteRegistration $routes */
347347 $ routes = Nova::routes ();
348348
349+ $ this ->features = collect ($ this ->features ?? [])->merge (array_filter ([
350+ $ routes ->withPasswordReset ? Features::resetPasswords () : null ,
351+ $ routes ->withEmailVerification ? Features::emailVerification () : null ,
352+ ]))->unique ()->all ();
353+
349354 Nova::serving (function (ServingNova $ event ) use ($ routes ) {
350355 $ this ->sync ();
351356
0 commit comments