public function index() { $start = Carbon::today()->startOfDay(); $end = Carbon::today()->endOfDay(); $bookings = Booking::whereBetween('updated_at', [$start, $end])->where('status', 'paid')->lists('travel_company_id'); $todayBookingsCompanies = array_unique($bookings->toArray()); // $com_list = Payment::whereBetween('updated_at', [$start, $end]) // ->lists('travel_company_id') // ->toArray(); // $c_lists = array_unique($com_list); $today_companies = TravelCompany::whereIn('id', $todayBookingsCompanies)->get(); // dd($todayBookingsCompanies, $bookings, $today_companies); return view('admin.accounting.index', ['companies' => $today_companies])->with('bookings', $bookings); }