Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 2, 2020
1 parent 31874d0 commit ff155d0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion config/fortify.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'passwords' => 'users',
'username' => 'email',
'email' => 'email',
'disable_views' => false,
'views' => true,
'home' => '/home',
'limiters' => [
'login' => null,
Expand Down
16 changes: 8 additions & 8 deletions routes/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
use Laravel\Fortify\Http\Controllers\VerifyEmailController;

Route::group(['middleware' => config('fortify.middleware', ['web'])], function () {
$disableViews = config('fortify.disable_views');
$enableViews = config('fortify.views', true);

// Authentication...
if (! $disableViews) {
if ($enableViews) {
Route::get('/login', [AuthenticatedSessionController::class, 'create'])
->middleware(['guest'])
->name('login');
Expand All @@ -41,7 +41,7 @@

// Password Reset...
if (Features::enabled(Features::resetPasswords())) {
if (! $disableViews) {
if ($enableViews) {
Route::get('/forgot-password', [PasswordResetLinkController::class, 'create'])
->middleware(['guest'])
->name('password.request');
Expand All @@ -62,7 +62,7 @@

// Registration...
if (Features::enabled(Features::registration())) {
if (! $disableViews) {
if ($enableViews) {
Route::get('/register', [RegisteredUserController::class, 'create'])
->middleware(['guest'])
->name('register');
Expand All @@ -74,7 +74,7 @@

// Email Verification...
if (Features::enabled(Features::emailVerification())) {
if (! $disableViews) {
if ($enableViews) {
Route::get('/email/verify', [EmailVerificationPromptController::class, '__invoke'])
->middleware(['auth'])
->name('verification.notice');
Expand Down Expand Up @@ -104,7 +104,7 @@
}

// Password Confirmation...
if (! $disableViews) {
if ($enableViews) {
Route::get('/user/confirm-password', [ConfirmablePasswordController::class, 'show'])
->middleware(['auth'])
->name('password.confirm');
Expand All @@ -119,7 +119,7 @@

// Two Factor Authentication...
if (Features::enabled(Features::twoFactorAuthentication())) {
if (! $disableViews) {
if ($enableViews) {
Route::get('/two-factor-challenge', [TwoFactorAuthenticatedSessionController::class, 'create'])
->middleware(['guest'])
->name('two-factor.login');
Expand All @@ -138,7 +138,7 @@
Route::delete('/user/two-factor-authentication', [TwoFactorAuthenticationController::class, 'destroy'])
->middleware($twoFactorMiddleware);

if (! $disableViews) {
if ($enableViews) {
Route::get('/user/two-factor-qr-code', [TwoFactorQrCodeController::class, 'show'])
->middleware($twoFactorMiddleware);

Expand Down
26 changes: 13 additions & 13 deletions stubs/fortify.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,6 @@

'email' => 'email',

/*
|--------------------------------------------------------------------------
| Disable Views
|--------------------------------------------------------------------------
|
| Here you may specify if the routes returning views should be disabled.
| You might want to activate this configuration if you are using your
| own front-end and you want to keep your application routes clean.
|
*/

'disable_views' => false,

/*
|--------------------------------------------------------------------------
| Home Path
Expand Down Expand Up @@ -104,6 +91,19 @@
'login' => null,
],

/*
|--------------------------------------------------------------------------
| Register View Routes
|--------------------------------------------------------------------------
|
| Here you may specify if the routes returning views should be disabled as
| you may not need them when building your own application. This may be
| especially true if you're writing a custom single-page application.
|
*/

'views' => true,

/*
|--------------------------------------------------------------------------
| Features
Expand Down

0 comments on commit ff155d0

Please sign in to comment.