File tree Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change 16
16
17
17
class Fortify
18
18
{
19
+ /**
20
+ * Indicates if Fortify routes will be registered.
21
+ *
22
+ * @var bool
23
+ */
24
+ public static $ registersRoutes = true ;
25
+
19
26
/**
20
27
* Get the username used for authentication.
21
28
*/
@@ -172,4 +179,16 @@ public static function resetUserPasswordsUsing(string $callback)
172
179
{
173
180
return app ()->singleton (ResetsUserPasswords::class, $ callback );
174
181
}
182
+
183
+ /**
184
+ * Configure Fortify to not register its routes.
185
+ *
186
+ * @return static
187
+ */
188
+ public static function ignoreRoutes ()
189
+ {
190
+ static ::$ registersRoutes = false ;
191
+
192
+ return new static ;
193
+ }
175
194
}
Original file line number Diff line number Diff line change @@ -109,12 +109,14 @@ protected function configurePublishing()
109
109
*/
110
110
protected function configureRoutes ()
111
111
{
112
- Route::group ([
113
- 'namespace ' => 'Laravel\Fortify\Http\Controllers ' ,
114
- 'domain ' => config ('fortify.domain ' , null ),
115
- 'prefix ' => config ('fortify.path ' ),
116
- ], function () {
117
- $ this ->loadRoutesFrom (__DIR__ .'/../routes/routes.php ' );
118
- });
112
+ if (Fortify::$ registersRoutes ) {
113
+ Route::group ([
114
+ 'namespace ' => 'Laravel\Fortify\Http\Controllers ' ,
115
+ 'domain ' => config ('fortify.domain ' , null ),
116
+ 'prefix ' => config ('fortify.path ' ),
117
+ ], function () {
118
+ $ this ->loadRoutesFrom (__DIR__ .'/../routes/routes.php ' );
119
+ });
120
+ }
119
121
}
120
122
}
You can’t perform that action at this time.
0 commit comments