Level 75
No, not if the key isn't the actual id of the book.
$book->id;
seems that would be an id.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How to pass dynamic value (key) to the html table id ? here is my code
<tbody>
@foreach($data as $key => $book)
<tr class="clickable" data-toggle="collapse" id="{{$key}}" data-target=".{{$key}}">
Is that make sense ?? It is not working as expected. Any help that would be great. Thanks!
Do you mean like this?
@foreach($data as $student)
<tr class="clickable" data-toggle="collapse" id="row{{$student->id}}" data-target=".row{{$student->id}}">
Please or to participate in this conversation.