Skip to content

Commit

Permalink
Edit README
Browse files Browse the repository at this point in the history
  • Loading branch information
mfrouh committed Sep 1, 2022
1 parent ffe3abe commit 9f116d4
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,69 @@ $statistic_in_hour =

### 3- Statistic In Month

```php

// by default using column 'created_at'

$statistic_in_month = Order::statisticInMonth();


// or can use custom column

$statistic_in_month = Order::statisticInMonth('updated_at');

$cancelled_statistic_in_month = Order::where('status','cancelled')->statisticInMonth();

// response will be with 100 Order

$statistic_in_month =
[
"january" => 12,
"february" => 7,
"march" => 10,
"april" => 12,
"may" => 13,
"june" => 5,
"july " => 8,
"august" => 6,
"september" => 7,
"october" => 6,
"november" => 6,
"december" => 8,
]

```

### 4- Statistic In Term

```php

// by default using column 'created_at'
// by default using count_months 3
// count_months can be 3,6
// term1 in 3 month will data in january , february , march

// every 3 month
$statistic_in_term = Order::statisticInTerm();

// every 6 month
$statistic_in_term = Order::statisticInTerm('created_at',6);


// or can use custom column

$statistic_in_term = Order::statisticInTerm('updated_at');

$cancelled_statistic_in_term = Order::where('status','cancelled')->statisticInTerm();

// response will be with 100 Order

$statistic_in_term =
[
"term1" => 29,
"term2" => 30,
"term3" => 21,
"term4" => 20,
]

```

0 comments on commit 9f116d4

Please sign in to comment.