@@ -15,9 +15,12 @@ class AdminLTEPreset extends Preset
15
15
/** @var Command */
16
16
protected $ command ;
17
17
18
- public function __construct (Command $ command )
18
+ public $ isFortify = false ;
19
+
20
+ public function __construct (Command $ command , $ isFortify = false )
19
21
{
20
22
$ this ->command = $ command ;
23
+ $ this ->isFortify = $ isFortify ;
21
24
}
22
25
23
26
/**
@@ -89,7 +92,10 @@ public function installAuth()
89
92
$ this ->ensureDirectoriesExist ($ viewsPath );
90
93
91
94
$ this ->scaffoldAuth ();
92
- $ this ->scaffoldController ();
95
+
96
+ if (!$ this ->isFortify ) {
97
+ $ this ->scaffoldController ();
98
+ }
93
99
}
94
100
95
101
protected function ensureDirectoriesExist ($ viewsPath )
@@ -107,6 +113,24 @@ protected function ensureDirectoriesExist($viewsPath)
107
113
}
108
114
}
109
115
116
+ private function addAuthRoutes ()
117
+ {
118
+ file_put_contents (
119
+ base_path ('routes/web.php ' ),
120
+ "\nAuth::routes(); \n" ,
121
+ FILE_APPEND
122
+ );
123
+ }
124
+
125
+ private function addHomeRoute ()
126
+ {
127
+ file_put_contents (
128
+ base_path ('routes/web.php ' ),
129
+ "\nRoute::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home'); \n" ,
130
+ FILE_APPEND
131
+ );
132
+ }
133
+
110
134
protected function scaffoldController ()
111
135
{
112
136
if (!is_dir ($ directory = app_path ('Http/Controllers/Auth ' ))) {
@@ -128,11 +152,11 @@ protected function scaffoldAuth()
128
152
{
129
153
file_put_contents (app_path ('Http/Controllers/HomeController.php ' ), $ this ->compileHomeControllerStub ());
130
154
131
- file_put_contents (
132
- base_path ( ' routes/web.php ' ),
133
- " Auth::routes(); \n\n Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home'); \n\n" ,
134
- FILE_APPEND
135
- );
155
+ $ this -> addHomeRoute ();
156
+
157
+ if (! $ this -> isFortify ) {
158
+ $ this -> addAuthRoutes ();
159
+ }
136
160
137
161
tap (new Filesystem (), function ($ filesystem ) {
138
162
$ filesystem ->copyDirectory (__DIR__ .'/../adminlte-stubs/auth ' , resource_path ('views/auth ' ));
0 commit comments