Skip to content

Commit 83566ba

Browse files
committed
feat: Fortify made optional
1 parent ecee202 commit 83566ba

File tree

2 files changed

+26
-24
lines changed

2 files changed

+26
-24
lines changed

src/AdminLTEPreset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private function addHomeRoute()
126126
{
127127
file_put_contents(
128128
base_path('routes/web.php'),
129-
"\nRoute::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');\n\n",
129+
"\nRoute::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');\n",
130130
FILE_APPEND
131131
);
132132
}

src/FortifyAdminLTEPresetServiceProvider.php

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,30 @@ public function boot()
2424
$command->comment('Please run "npm install && npm run dev" to compile your fresh scaffolding.');
2525
});
2626

27-
Fortify::loginView(function () {
28-
return view('auth.login');
29-
});
30-
31-
Fortify::registerView(function () {
32-
return view('auth.register');
33-
});
34-
35-
Fortify::confirmPasswordView(function () {
36-
return view('auth.passwords.confirm');
37-
});
38-
39-
Fortify::requestPasswordResetLinkView(function () {
40-
return view('auth.passwords.email');
41-
});
42-
43-
Fortify::resetPasswordView(function (Request $request) {
44-
return view('auth.passwords.reset');
45-
});
46-
47-
Fortify::verifyEmailView(function () {
48-
return view('auth.verify');
49-
});
27+
if (class_exists(Fortify::class)) {
28+
Fortify::loginView(function () {
29+
view('auth.login');
30+
});
31+
32+
Fortify::registerView(function () {
33+
view('auth.register');
34+
});
35+
36+
Fortify::confirmPasswordView(function () {
37+
view('auth.passwords.confirm');
38+
});
39+
40+
Fortify::requestPasswordResetLinkView(function () {
41+
view('auth.passwords.email');
42+
});
43+
44+
Fortify::resetPasswordView(function (Request $request) {
45+
view('auth.passwords.reset');
46+
});
47+
48+
Fortify::verifyEmailView(function () {
49+
view('auth.verify');
50+
});
51+
}
5052
}
5153
}

0 commit comments

Comments
 (0)