Here is what i'm getting when i fetch data from its database.
So that i want to split into 2 different column.can anyone help me here? Here is the view.
<table class="table table-striped">
<thead>
<th>Trainee ID</th>
<th>Name with initials</th>
<th>On time</th>
</thead>
<tbody>
@foreach($items as $item)
<tr>
<td>{{ $item->trainee_id }}</td>
<td>{{ $item->name }}</td>
<td>{{ $item->time }}</td>
</tr>
@endforeach
</tbody>
</table>
<table class="table table-striped">
<thead>
<th>Trainee ID</th>
<th>Name with initials</th>
<th>On Date</th>
<th>On Time</th>
</thead>
<tbody>
@foreach($items as $item)
<?php
$temp = explode(' ',$item->time);
?>
<tr>
<td>{{ $item->trainee_id }} </td>
<td>{{ $item->name}}</td>
<td>{{ $temp[0] }}</td>
<td>{{ $temp[1] }}</td>
</tr>
@endforeach
</tbody>
</table>
try this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With