Skip to content

Made it possible to publish and edit routes.#4

Open
leon-fablr wants to merge 1 commit intoalt-design:mainfrom
leon-fablr:feature/publishable-routes
Open

Made it possible to publish and edit routes.#4
leon-fablr wants to merge 1 commit intoalt-design:mainfrom
leon-fablr:feature/publishable-routes

Conversation

@leon-fablr
Copy link
Copy Markdown
Contributor

@leon-fablr leon-fablr commented May 12, 2025

I can't actually find any way to edit the URIs of the routes this package uses. This PR is intended to address that.

This allows the projects using this package to publish the package's routes to routes/vendor/alt-google-2fa/ so they can be edited. The changes also make the service provider check for these and use them if present. It should be a case of running this and editing the files it creates:

artisan vendor:publish --tag=alt-google-2fa-routes

If there's a better way to make these URIs editable, I'm open to suggestions. I can absolutely understand if you don't want to expose these files - I'd imagine there's potential for a maintenance headache if you ever need to add new routes. However, from what I gather the next version of Statamic is going to have 2FA built in, so it probably won't be an issue?

Apologies if this isn't very idiomatic to Laravel - I'm pretty new to using it. I'm absolutely fine with any tweaks to this if you're happy with the core approach or an entirely different approach if you're not.

web.php and cp.php are published to routes/vendor/alt-google-2fa/
and the extension will load these instead of its routes/ files.
@Alt-Ben Alt-Ben self-assigned this May 12, 2025
@Alt-Ben Alt-Ben self-requested a review May 12, 2025 15:15
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.

2 participants