I'm working on Laravel 5.6 and in my controller I am pulling some data from an api which I am storing in a variable and passing it to the view. $orders is the variable.
In my view I have this block of code.
@foreach($orders as $order)
                                  <tbody>
                                      <tr>
                                          <td>{{ \Carbon\Carbon::parse($order->created_at)->format('m/d/Y') }}</td>
                                          <td>{{ $order->order_number }}</td>
                                          <td><input type="checkbox" data-toggle="switch" class="ct-primary" id="printing" value="0" /></td>
                                          <td><input type="checkbox" data-toggle="switch" class="ct-primary" id="engraving1" value="0" /></td>
                                          <td><input type="checkbox" data-toggle="switch" class="ct-primary" id="engraving2"  value="0" /></td>
                                          <td><input type="checkbox" data-toggle="switch" class="ct-primary" id="assembly"  value="0" /></td>
                                          <td><input type="checkbox" data-toggle="switch" class="ct-primary" id="completed"  value="0" /></td>
                                          <td><button class="btn btn-info btn-fill btn-sm"><a href="orders/{{ $order->id }}" style="color: #FFFFFF">Details</a></button></td>
                                      </tr>
                                      <tr>
                                  </tbody>
                                  @endforeach
The above is a foreach loop that goes through each order and posts it in my view... There are 200 results... Easy enough. However below it using Jquery I need to store the details into a database and run some more actions. To test out how it interacts with Jquery I've done the following code.
          $(document).on('change', '#printing', function() {
              console.log({{ $order->order_number }});
          });
The problem I'm having is that $order->order_number is only the first number that is loaded when the foreach loop starts. So in the example this console.log would be 37311. My question is how would I be able to make this jquery call:
 $(document).on('change', '#printing', function() {
              console.log({{ $order->order_number }});
          });
I had also tried this making each id unique:
id="printing{{ $order->order_number }}".
Then in jquery ('#printing{{ $order->order_number }}') however that did not solve it.
equal to each order number in the for each?
 
    