Skip to content

Commit

Permalink
Added some clarifications to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
djl997 committed Nov 6, 2023
1 parent e1f6f4a commit 2d49a15
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,27 @@ You even can add a custom date to datetime, time, year, month or day, for exampl
@year('2022-11-08')
```

#### Cascades
#### Carbon Cascades
If you want to display a certain amount of time in human readable format, try out the new cascade directives. For example:
```blade
@cascadeFromMinutes(125) <!-- 2h 5m -->
@cascadeFromHours(146) <!-- 6d 2h -->
```

Change the Carbon Interval. For example, if a company has 30 working hours available per day, how long will a project of 125 hours take?
##### Change the time unit
If you set the time unit (2nd item in the array), the cascade will cascade max to the given unit.
```blade
@cascadeFromMinutes(1530) <!-- 1d 1h 30m -->
@cascadeFromMinutes([1530, ['hour' => 60]]) <!-- 25h 30m, (Please notice the use of an array!) -->
```

##### CarbonInterval
The example above also means you can tweak the [CarbonInterval](https://carbon.nesbot.com/docs/#api-interval). Suppose you have a project that requires 125 hours of work and you can allocate 30 hours per day for it. How many days will it take to complete the project?
```blade
@cascadeFromHours([125, ['day' => 30]]) <!-- 4d 5h -->
```


### Filesize
```blade
@filesize(2145) <!-- 2 kB -->
Expand Down

0 comments on commit 2d49a15

Please sign in to comment.