Comment obtenir une année de données sur le terrain dans la collection Laravel
$post = Post::find(2);
$year = $post->created_at->year;
$month = $post->created_at->month;
Mohamad