Add the $vote var to your route:
Route::post("/vote/{vote}", ["before" => "csrf", function($vote) {
DB::table("votes")->insert(["vote" => $vote]);
}]);
And make sure your AJAX request submits the CSRF token.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community