Skip to content

Commit

Permalink
Fix #10
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
eliseekn committed Oct 28, 2023
1 parent a3d6361 commit aedb5ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ LaravelMetrics::query(...)

LaravelMetrics::query(...)
->countBetween([Carbon::now()->subDays(10)->format('Y-m-d'), Carbon::now()->format('Y-m-d')])
->groupByDay()
->trends();

...
Expand Down Expand Up @@ -258,13 +257,12 @@ LaravelMetrics::query(...)
```

### Group period (only when using ```between``` method)
You can group period by days, months, weeks or years when using the ```between``` method (***default is year***). For example :
You can group period by days, months, weeks or years when using the ```between``` method (***default is day***). For example :

```php
LaravelMetrics::query(...)
->countBetween([Carbon::now()->subDays(10)->format('Y-m-d'), Carbon::now()->format('Y-m-d')])
->fillMissingData()
->groupByMonth()
->trends();
```

Expand Down
2 changes: 1 addition & 1 deletion src/LaravelMetrics.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function __construct(protected Builder|QueryBuilder $builder)
$this->month = Carbon::now()->month;
$this->day = Carbon::now()->day;
$this->week = Carbon::now()->week;
$this->groupBy = Period::YEAR->value;
$this->groupBy = Period::DAY->value;
}

public static function query(Builder|QueryBuilder $builder): self
Expand Down

0 comments on commit aedb5ff

Please sign in to comment.