laravel livewire I'm using whereMonth inside foreach but I'm getting error
error
Method Illuminate\Database\Eloquent\Collection::whereMonth does not exist.
My blade
@foreach ($this->Data as $key=>$Datas)
<tr>
<td >
>{{$Datas->where('user_id','=',$Datas[0]->user_id)
->whereMonth('date','=',$this->MonthToNumber)
->where('status','=', 1 )->count() }}
</td>
</tr>
@endforeach
You can use
whereBetweenmethod in your application it might help you