Eager load issue

I have a relation manager with eager load, i am using dot notation for the values, for some reason the data in a table shows in one row, instead of having a new row for each related data. Any help?

public function table(Table $table): Table
    {
        return $table
            ->emptyStateHeading('No Subscriptions Found')
            ->modifyQueryUsing(fn(Builder $query) => $query->whereHas('subscriptions'))
            ->columns([
                Tables\Columns\TextColumn::make('subscriptions.stripe_id')
                    ->label('Subscribe ID')
                    ->badge()
                    ->copyable(),
            ])
            ->filters([
                //
            ])
            ->headerActions([
                //Tables\Actions\CreateAction::make(),
            ]);
    }
Screenshot_2024-04-20_at_01.40.35.png
Solution
What you want is probably a left join to actually get multiple rows instead of eager loading a relation ship (which gives you a collection on every row)
Was this page helpful?