The route
Route::resource('users', 'UserController');
states, that the URL users/{parameter} is going to use show method in UserController. That is why, it is routing you there.
There is a mistake you made:
<a href='site.com/users/logout'>
is actually a GET request. You defined your logout route to listen to POST request
Route::post('/users/logout', ['as'=>'logout', 'uses'=>'UserController@logout'])
Change the route to GET, try if it helps
TorchSK:
Thanks, funny thing, that clicked in my head about 5 seconds before I read your reply. It's the 'ether' net, man... lol. One thing I had to change was that I had to define those routes ABOVE the resource - I forgot which order the hierarchy was. Problem solved :)
And did you change the route to logout to GET? Cause on second thought, it is not recomended to use GET for logout (although I am using it :)) )
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community