Friends, many times there is such data inside the database which keeps repeating multiple times and what we need is that we need only unique answers from them, I am running a restaurant, in this I have some special ones which are repeating but I have to show them in the menu bar.
And I want to show only one direction in navigation and not its repeated value, so how can I use in Laravel to get unique data on such condition, let’s discuss below:
$sup_ids = DB::table('collect_milk2')->where('status', 0)->get()->unique('username');
$countsubscriber = DB::table('userplans')->get()->unique('user_id')->count();