I want to print the name of the current date in laravel 5.3. I can get the current date in following ways:
<?php use Carbon\Carbon;
$carbon=Carbon::now();
echo $carbon->day;?>
The above code prints 25 but I want it to print Thursday.How should I do that??
Try this
After Laravel 5.5 you can use now() function to get the current date and time.
In blade file, you can write like this to print name of current day.
Carbon::now()->format('l')
works but I would recommend usingCarbon::now()->formatLocalized('%A')
seeing that this would translate the day string according to the current set locale in case your app is going support internationalization.