0
I have the score function of a control with the following code :
public function score($ids, $points) {
$score = Team::find($ids)->increment('points', $points) ;
The $ids field will receive several id’s that I am writing to an Hidden input. The idea is to take the id and increase the score of those who are in the input. For example, it will have 3,4,6,10. I load the points from another controller, simply declaring $quest->points. How do I pass these two parameters using a button?
Are you passing this from a form? Ever tried to put the button with type Submit?
– adventistaam
I’m trying to pass without using form. I want to use like this:
{{route('team.score',input_ids,$question->points)}}
. This input_ids is the Hidden input with the id’s that will be incremented– Alessandro Carvalho
Are you using something else? Like a jquery?
– adventistaam
Exactly. How do I do this via jquery?
– Alessandro Carvalho
Then convert the button to href and add the btn class and attributes
data-id=$id
anddata-question=$points
from there you can do the sending with ajax– adventistaam