carbon get date by day of week 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');