i have something problem in there i want to change date format. this my view :
@foreach ($posts as $post)
<tr>
<td>
<?php echo $post->id?>
</td>
<td class="mailbox-star"><?php echo $post->nama?></td>
<td class="mailbox-name"><?php echo $post->tanggal?></td>
<td class="mailbox-subject"><?php echo $post->deskripsi?></td>
<td class="mailbox-date"><?php echo $post->mulai?> - <?php echo $post->durasi?></td>
<td class="mailbox-date"><?php echo $post->total?> Jam</td>
<td class="mailbox-date">
<a href="<?php echo url('user/detail/'.$post->nama)?>" class="btn btn-xs btn-danger"><i class="fa fa-search-plus"></i></a>
<a href="<?php echo url('user/edit/'.$post->id)?>" class="btn btn-xs btn-success"><i class="fa fa-pencil-square-o"></i></a>
<a href="<?php echo url('user/delete/'.$post->id) ?>" class="btn btn-xs btn-warning"><i class="fa fa-times"></i></a>
</td>
</tr>
@endforeach
and my controller :
public function getIndex()
{
$posts = DB::table("lembur_karyawan")
->orderBy('id', 'desc')
->paginate(6);
return view('user',['posts'=>$posts]);
}
this my view and what i want to do:
if someone tell me to use carbon please explain how to use it ?
NB : i use laravel 5.1