carbon now get year code example
Example 1: carbon date from format
Carbon::createFromFormat('Y-m-d H:i:s', $request->date)->format('d-m-Y')
Example 2: 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
Example 3: laravel carbon human readable
$comment->created_at->diffForHumans();