You can use the groupBy collection method to group all records by date:
public function index()
{
$actones = Actone::latest()->paginate(50)
->groupBy(function ($acetone) {
return $acetone->created_at->toDateString();
});
return view('admin.activities.actone.index')->withActones($actones);
}
... and then you will have nested collections to iterate over (I am showing a div with a group class for containing the cards):
@foreach($acetones as $date => $group)
<div class="group">
{{ $date }}
@foreach ($group as $acetone)
<div class="card">
<div class="card-content">
<h1>{{$actone->id}}</h1>
<h1>{{$actone->category}}</h1>
<h1>{{$actone->time}}</h1>
<h1>{{$actone->name}}</h1>
<h1>{{date('d/m/Y - H:i', strtotime($actone->created_at))}}</td>
</div>
</div> <!-- end of .card -->
@endforeach
</div>
@endforeach