1. Go to this page and download the library: Download omitobisam/carbonate library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
omitobisam / carbonate example snippets
$result = $mydate->everyWeekendDays($enddate);
//
/*
* Result - A collection of dates in the weekend
*/
//
Illuminate\Support\Collection Object ( [items:protected] => Array (
[0] => Carbonate\Carbonate Object ( [date] => 2017-09-02 00:00:00.000000 [timezone_type] => 3 [timezone] => UTC )
[1] => Carbonate\Carbonate Object ( [date] => 2017-09-03 00:00:00.000000 [timezone_type] => 3 [timezone] => UTC )
[2] => Carbonate\Carbonate Object ( [date] => 2017-09-09 00:00:00.000000 [timezone_type] => 3 [timezone] => UTC )
.......
// Verify if the last Carbon instance is actually weekend
$mydate->everyWeekendDays($enddate)->last()->isWeekend();