975 0 0 0
Last Updated : 2025-04-28 21:58:03
This snippet will teach you how to get distinct values from database using eloquent
To get distinct values you should use distinct() method like below
$days = Reading::whereNotNull('day')->orderby('id', 'DESC')->distinct()->take(6)->pluck('day');
// whereNotNull('column) used to get not null values