php - laravel 8: axios.post not working on controller

one text

Solution:

Your resource route Route::resource('posts', PostsController::class); does not make /posts/{post}/react available, it only makes CRUD routes (index,create,edit...) available. (A complete list of actions available can be found in the documentation: Actions Handled By Resource Controller)

You need to add a route that specifically handles your use case. Add this route to your web.php:

Route::post('/posts/{id}/react', [PostController::class, 'react']);

Source