Skip to content

Commit cc89189

Browse files
committed
Removed notice on Carbon's "cascade" methods since fix in PR #106
1 parent f8b368d commit cc89189

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ Your website will need a dedicated "Cookie Policy" page containing extensive inf
443443
<tr>
444444
<td>{{ $cookie->name }}</td>
445445
<td>{{ $cookie->description }}</td>
446-
<td>{{ \Carbon\CarbonInterval::minutes($cookie->duration)->cascade() }}</td>
446+
<td>{{ \Carbon\Carbon::now()->diffForHumans(\Carbon\Carbon::now()->addMinutes($cookie->duration), true) }}</td>
447447
</tr>
448448
@endforeach
449449
</tbody>
@@ -453,16 +453,6 @@ Your website will need a dedicated "Cookie Policy" page containing extensive inf
453453
<p>...</p>
454454
```
455455

456-
A side note on `Carbon\CarbonInterval`'s `cascade` method: when working with years, some unexpected results could appear. By default, the `CarbonInterval` "year" factor will return 336 days instead of 365. It is possible to change this by defining your own factors (for instance in `App\Providers\AppServiceProvider`):
457-
458-
```php
459-
$factors = \Carbon\CarbonInterval::getCascadeFactors();
460-
$factors['years'] = [365, 'dayz'];
461-
\Carbon\CarbonInterval::setCascadeFactors($factors);
462-
```
463-
464-
More information on CarbonInterval's gotchas in [Constantin's blog post on chasingcode.dev](https://chasingcode.dev/blog/carbon-php-practical-examples/).
465-
466456
### Let your users change their mind
467457

468458
Users should be able to change their consent settings at any time. No worries, with this package it is quite simple to achieve: generate a button that will reset the user's cookies and show the consent modal again.

0 commit comments

Comments
 (0)