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

How to Skip some routes from going to WebsiteController@uri #30

Closed
SoftHeroes opened this issue Aug 17, 2020 · 2 comments
Closed

How to Skip some routes from going to WebsiteController@uri #30

SoftHeroes opened this issue Aug 17, 2020 · 2 comments

Comments

@SoftHeroes
Copy link

Hello @HansSchouten

I just follow this guide. And everything is working fine. But my old route Like 'http://example.test/my-admin/login' this route also handle by WebsiteController@uri method.

I just want some URL's to ignore to going that method.

Can you help me to do that

@SoftHeroes
Copy link
Author

I just did some trick to work around this as bellow.

Route::any('/{uri}', [
    'uses' => 'WebsiteController@uri',
    'as' => 'page',
])->where('uri', '^((?!<1-route>|<12-route>|<3-route>|....|<n-route>).)*$');

Hey, @HansSchouten

I am not closing this issue maybe you may give a better solution.
If you feel you can close this. but I suggest just add param in the config for the route to skip or option to a prefix of the route(or array for routes path).

@HansSchouten
Copy link
Owner

Hi @SoftHeroes,

What I usually do is ensure this is the last route, so all other matches will be handled first and this is a sort of catch-all.
But I will consider the config suggestion, sounds like another usefull way for some situations.

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

No branches or pull requests

2 participants