Skip to content

Commit

Permalink
Merge pull request #33 from gauravmak/patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
freekmurze authored Jul 20, 2023
2 parents 5c6563d + 7c0b83f commit 572e9ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ $count = AnAPi::getSubscriptionCount();
SubscriptionStats::set($count);
```

By default, that `increase`, `decrease` and `sets` methods assume that the event that caused your stats to change, happened right now. Optionally, you can pass a date time as a second parameter to these methods. Your stat change will be recorded as if it happened on that moment.
By default, that `increase`, `decrease` and `set` methods assume that the event that caused your stats to change, happened right now. Optionally, you can pass a date time as a second parameter to these methods. Your stat change will be recorded as if it happened on that moment.

```php
SubscriptionStats::increase(1, $subscription->created_at);
```

### Step 3: query the stats

With this in place, you can query the stats. You can fetch stats for a certain period and group it by day, week, month.
With this in place, you can query the stats. You can fetch stats for a certain period and group them by minute, hour, day, week, month, or year.

Here's how you can get the subscription stats for the past two months,
grouped by week.
Expand Down

0 comments on commit 572e9ce

Please sign in to comment.