Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way of customizing/disabling the default routes #13

Merged
merged 4 commits into from
Sep 8, 2020

Conversation

MarkIvanowich
Copy link

@MarkIvanowich MarkIvanowich commented Sep 5, 2020

A mirror of Jetstream's laravel/jetstream#67

Enables a user to call Fortify::ignoreRoutes() in a provider's register method to disable the default routes and provide their own.
Also enables publishing of default routes into userland.

Relevant are #9, #10

@MarkIvanowich
Copy link
Author

The Jetstream's version was merged while this one was closed? I figured since these two packages went hand-in-hand that they should be consistent in functionality.

I want to move my application login pages away from common endpoints that are typically brute forced. (/login, /wp-login, etc) Adding a prefix to the login route adds just enough additional security through obscurity.

@taylorotwell taylorotwell reopened this Sep 8, 2020
@taylorotwell taylorotwell merged commit f29ed3f into laravel:master Sep 8, 2020
@rodrigopedra
Copy link
Contributor

Thanks @taylorotwell

Much appreciated! =)

@anhofmann
Copy link

anhofmann commented Sep 11, 2020

Why was the PR only partially merged?
Publishing the routes did not make it into the master branch, or do I see it wrong?
If I want to adjust my routes, do I copy them manually from fortify into my routes, or what is the right way? I am relatively new to laravel and am trying to build customized login/register routes for different user roles in my app. A single prefix is (sadly) not enough for my App.

@driesvints
Copy link
Member

@anhofmann you can just copy/paste them into your own routes.

@nicolailebek
Copy link

nicolailebek commented Sep 15, 2020

I copied "vendor/laravel/fortify/routes/routes.php" to "routes/fortify.php".

Then in "App/Providers/FortifyServiceProvider.php":

public function boot() {
        $this->configureRoutes();
        ...
}

/**
 * Configure the routes offered by the application.
 *
 * @return void
 */
protected function configureRoutes()
{
    if (Fortify::$registersRoutes) {
        Route::group([
            'namespace' => 'Laravel\Fortify\Http\Controllers',
            'domain' => config('fortify.domain', null),
            'prefix' => config('fortify.path'),
        ], function () {
            $this->loadRoutesFrom(base_path('routes/fortify.php'));
        });
    }
}

Did the same with jetstream's routes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants