Answers for "laravel carbon get day name"

PHP
1

laravel carbon get day name

use Carbon\Carbon;

Carbon::now()->format("l") // today's day name. example: Sunday
Posted by: Guest on October-20-2021
3

carbon get today's month

use Carbon\Carbon;

// if today is January 22, 2021
Carbon::now()->format('M'); // "Jan"
Carbon::now()->format('m'); // "01"
Carbon::now()->month; // 1
Posted by: Guest on January-22-2021
0

carbon get day name from date

Carbon::tomorrow()->format('l');
Posted by: Guest on July-01-2021
0

laravel carbon created_at date in current month

public function myMonthApts()
{
        return $this->appointments()
                        ->whereIn('status_id', [3,4])
                        ->whereYear('created_at', Carbon::now()->year)
                        ->whereMonth('created_at', Carbon::now()->month)
                        ->count();
}
Posted by: Guest on September-13-2021

Browse Popular Code Answers by Language