Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ahmadbadpey's avatar

how to get stats of a specific date via antonioribeiro/tracker laravel package

For Storing user tracking information, I used (antonioribeiro/tracker)[https://github.com/antonioribeiro/tracker] laravel package.

In this package to get sessions (visits) from the past day , should use like this:

$sessions = Tracker::sessions(60 * 24);

But I am trying to get visits of a specific day (for Example yesterday or the day before yesterday) or a specific date range like form 01/22/2016 to 01/25/2016.

For yesterday page views I try this:

$yesterday = Carbon::yesterday();
$today     = Carbon::today();

$yesVisits = Tracker::sessions($yesterday->diffInMinutes($today))->count();

But it returns all page views from 00:00:00 of yesterday to 00:00:00 of today. How can I do that?

0 likes
0 replies

Please or to participate in this conversation.