0

So basically i want to create a route like http://example.com/{page_slug} on my laravel app, but when i register that in my routes file it affects pages like http://example.com/login as it give me an error related to page "login" not found.

Here is my route with the page slug parameter

Route::get('/{slug}','Admin\PageController@viewPage');

The login route id generated automatically, i'm using laravel 5.4

Any help is appreciated

1 Answer 1

1

I found the solution:

All i had to do was put the

Route::get('/{slug}','Admin\PageController@viewPage');

As the last route, so other routes would be checked first.

Sign up to request clarification or add additional context in comments.

Comments

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.