Last active
March 30, 2020 01:46
-
-
Save martanto/766a6b1536afdc5b54e35d8802877c2d to your computer and use it in GitHub Desktop.
using times() method to create a list of next 7 days using the Carbon instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Collection; | |
$nextWeek = Collection::times(7, function ($index) { | |
return \Carbon\Carbon::now()->addDay($index); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment