Skip to content

Commit

Permalink
Update README.md (#42)
Browse files Browse the repository at this point in the history
* Update README.md

* Update README.md

* Update README.md
  • Loading branch information
ymigval authored Nov 6, 2023
1 parent c1d95fb commit 0461e38
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Generate trends for your models. Easily generate charts or reports.

## Why?

Most applications require charts or reports to be generated. Doing this over again, and again can be a painfull process. That's why we've created a fluent Laravel package to solve this problem.
Most applications require charts or reports to be generated. Doing this over again, and again can be a painful process. That's why we've created a fluent Laravel package to solve this problem.

You can aggregate average, min, max, and totals per minute, hour, day, month and year.
You can aggregate average, min, max, and totals per minute, hour, day, month, and year.

## Installation

Expand Down Expand Up @@ -84,6 +84,22 @@ You can use the following aggregates:
- `min('column')`
- `count('*')`

## Date Column

By default, laravel-trend assumes that the model on which the operation is being performed has a `created_at` date column. If your model uses a different column name for the date or you want to use a different one, you should specify it using the `dateColumn(string $column)` method.

Example:

```php
Trend::model(Order::class)
->dateColumn('custom_date_column')
->between(...)
->perDay()
->count();
```

This allows you to work with models that have custom date column names or when you want to analyze data based on a different date column.

## Drivers

We currently support three drivers:
Expand Down

0 comments on commit 0461e38

Please sign in to comment.