- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.4k
Open
Labels
Description
- Laravel-mongodb Version: 5.1
- PHP Version: 8.3
- Database Driver & Version:
Description:
Steps to reproduce
doesnt work it doesnt return the latest value,
 public function latestTwilioMessage(): HasOne
    {
        return $this->hasOne(TwilioMessageHistory::class)->latestOfMany('date_sent');
    }checking latestOfMany method it uses 
    public function latestOfMany($column = 'id', $relation = null)
    {
        return $this->ofMany((new Collection(Arr::wrap($column)))->mapWithKeys(function ($column) {
            return [$column => 'MAX'];
        })->all(), 'MAX', $relation);
    }For now I use this, seems to work ok.
 public function latestTwilioMessage(): HasOne
    {
        return $this->hasOne(TwilioMessageHistory::class)->latest('date_sent');
    }