I have the following voting links
<a href="#" data-comment-id="13" class="voteUp">▲</a>
<a href="#" data-comment-id="13" class="voteDown">▼</a>
And the following jQuery setting the click events to those buttons
$(document).on('click', '.voteUp', function(e) {
e.preventDefault();
var resourceId = $(this).data('comment-id');
var resourceType = 'comment';
castVote(resourceId, resourceType, 'upvote');
});
$(document).on('click', '.voteDown', function(e) {
e.preventDefault();
var resourceId = $(this).data('comment-id');
var resourceType = 'comment';
castVote(resourceId, resourceType, 'downvote');
});
If I log in in my application, go to a page where these links are and log out everything works. But if I make a vote and then log out it makes a GET request to the route('cast.vote')
instead of the logout route which gives me the following error.
The GET method is not supported for route vote. Supported methods: POST.