Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all period show the same result #75

Closed
ramouspeppy opened this issue Aug 28, 2021 · 2 comments · Fixed by #81
Closed

all period show the same result #75

ramouspeppy opened this issue Aug 28, 2021 · 2 comments · Fixed by #81
Labels

Comments

@ramouspeppy
Copy link

I want to show a visit by period like this day, this week, this month, this year and all the time.
but the result always show same result even I dont visit my web today.
the result from today is same like yesterday.

`

    $top10      = visits('App\Product','visits')->top(10);

    $allVisit   = visits('App\Product','visits')->count();

    $todayVisit = visits('App\Product','visits')->period('today')->count();

    $weekVisit  = visits('App\Product','visits')->period('week')->count();

    $monthVisit = visits('App\Product','visits')->period('month')->count();

    $yearVisit  = visits('App\Product','visits')->period('year')->count();

`

DATE VIEW
Today 14 -> I dont visit today, this supposed 0,
This Week 14
This Month 14
This Year 14
All The Time 14

@abdumu abdumu added the urgent Should be fixed soon label May 22, 2022
@abdumu
Copy link
Member

abdumu commented May 22, 2022

@if4lcon this is needed to be investigated before releasing any version of the package. I'll try for now, and see if I can reproduce it ...

@abdumu
Copy link
Member

abdumu commented May 22, 2022

@ramouspeppy

this

    $todayVisit = visits('App\Product','visits')->period('today')->count();

should be 'day' instead of 'today' ... we will add an exception to throw if you use a period that is not set in config/visits[periods] key in your config.

I hope this fixes it for you.

enjoy.

@abdumu abdumu closed this as completed May 22, 2022
@abdumu abdumu added invalid and removed urgent Should be fixed soon labels May 22, 2022
abdumu added a commit to abdumu/laravel-visits that referenced this issue May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants