get week from date carbon code example
Example: Day of Week Using carbon library
// CALCULATE DAY OF WEEK (USING CARBON LIBRARY Laravel)
use Carbon\Carbon;
// pass dynamic day
$date = "2021-5-18";
$day = new DateTime($date);
$dayOfWeek = $day->format('l');