Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kdotsmith's avatar

So haven looked at that, i noticed the same, surely my postings route should work in this instances. But is it because i have a route defined already for my welcome view (Route::get('/', 'PageController@index');) that i cant duplicate the route ?

Snapey's avatar

does your postings route not work?

kdotsmith's avatar

unfortunately not, even after trying what you advised above.

Snapey's avatar

ok, I'll try and be really simple about the question.

You visit /postings in your browser

What happens?

kdotsmith's avatar

So i do fyp.test/postings which is for some reason taking me to the login page. I had this slight error before where my login page would appear instead.

Also when i change my route to Route::get('/', 'HomeController@index'); this directs me to log in page

Snapey's avatar

because you have auth middleware in your HomeController constructor.

Strewth!

kdotsmith's avatar

But the auth middleware is required for the login requests right, so how would i overcome this issue

kdotsmith's avatar

Also is it worth creating a new controller say 'WelcomeController' and see if that works

Snapey's avatar

So i do fyp.test/postings which is for some reason taking me to the login page.

What did you expect? You have made the postings only accessible to logged in users.

I'll ask again, what are you trying to achieve?

kdotsmith's avatar

I simply created a new controller called WelcomeController, In my routes i did Route::get('/', 'WelcomeController@index'); and now my posts are appearing.

Id first like to apologies for the confusion i have called, but also thank for you for the help, i have only been learning laravel as of February so its a start for some.

Snapey's avatar
Snapey
Best Answer
Level 122

Please mark this epic as answered.

I hope you now appreciate that routes control what your site responds to, and views have nothing to do with routes, they are just the layout that any controller can use.

1 like
Snapey's avatar

hover over an answer you like. click 'Best Answer'

jaseofspades88's avatar

Is it possible to have watched any videos on Laracasts and be a Level 1? Asking for a friend.

kdotsmith's avatar

yo safe can you help me on another issue i have

Previous

Please or to participate in this conversation.