laravel carbon get month number
use Carbon\Carbon;
// Date = 7th of July 2021
$month = Carbon::now()->format('M'); // July
$month = Carbon::now()->format('m'); // 07
$month = Carbon::now()->month; // 7
laravel carbon get month number
use Carbon\Carbon;
// Date = 7th of July 2021
$month = Carbon::now()->format('M'); // July
$month = Carbon::now()->format('m'); // 07
$month = Carbon::now()->month; // 7
laravel carbon get month name español
Adding in the AppServiceProvider
public function boot()
{
// Configuración para fechas en español
Carbon::setUTF8(true);
Carbon::setLocale(config('app.locale'));
setlocale(LC_ALL, 'es_MX', 'es', 'ES', 'es_MX.utf8');
}
Ejemplo:
Carbon::parse($start_date)->formatLocalized('%B')
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us