5

I use laravel only as a backend for a mobile application, for this I use Laravel Sanctum api. I don’t need everything that is displayed in the browser on the site, so I want to disable all unnecessary routes for web. Some of the routes are quite simply removed from the file app/config/fortify.php. But there are a few routes that I don't need, such as login, logout or _ignition/execute-solution. Where they are located and how to disable them is not clear.

List of routes that fortify added and that I would like to disable.

  POST       _ignition/execute-solution
  GET|HEAD   _ignition/health-check
  POST       _ignition/update-config
  GET|HEAD   livewire/livewire.js
  GET|HEAD   livewire/livewire.js.map 
  POST       livewire/message/{name}
  GET|HEAD   livewire/preview-file/{filename}
  POST       livewire/upload-file
  POST       login
  POST       logout
  POST       user/confirm-password
  GET|HEAD   user/confirmed-password-status
  GET|HEAD   user/profile

2 Answers 2

6

To disable Fortify routes in your Laravel application, you can utilize the Fortify::ignoreRoutes() method. This method allows you to remove all Fortify routes.

Open FortifyServiceProvider.php and add this line Fortify::ignoreRoutes() to register method, your new code will look like this:

public function register(): void
{
    Fortify::ignoreRoutes();
}
Sign up to request clarification or add additional context in comments.

Comments

0

You can remove package like as:

composer remove facade/ignition
composer remove livewire/livewire

1 Comment

This completely removes the packages, not only the routes. I came looking for the same help and this doesn't address it. Any ideas for specifically disabling certain vendor routes?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.