Heei, I want to show data according to daterange. Specifically data on this day and 6 days to go. Here's my code now.
Controller
$hari = [];
for ($i=0; $i < 6; $i++)
{
$hari[] = date("Y M d") + $i;
}
$booking_room = jadwal_meeting::whereBetween('tanggal', [$hari, $hari + 6])->get();
return view('homepage')->with($booking_room);
Note: 'tanggal' is a field on table.
But I just get error like this
Unsupported operand types :
$booking_room = jadwal_meeting::whereBetween('tanggal', [$hari, $hari + 6])->get();
What's wrong with my code, anyone can help me please :)
$haria string or aCarboninstance?$harishould be a string