Pivot column value in relation manager table missing after allowDuplicates()

public function table(Table $table): Table
    {
        return $table
            ->deferLoading()
            ->recordTitleAttribute('name')
            ->allowDuplicates()
            ->columns([
                TextColumn::make('assetType.name')
                    ->searchable(),
                TextColumn::make('name')
                    ->searchable(),
                TextColumn::make('department.name')
                    ->searchable(),
                TextColumn::make('quantity'),
                TextColumn::make('dispatched_at')
                    ->dateTime(),
                TextColumn::make('returned_at')
                    ->dateTime(),
                TextColumn::make('returned_notes'),
            ])
            ->headerActions([
                AttachAction::make()
                    ->label('Add Assets')
                    ->preloadRecordSelect(),
            ])
            ->recordActions([
                Action::make('dispatch_asset')
                    ->requiresConfirmation()
                    ->icon(LucideIcon::Car)
                    ->visible(fn (Asset $record): bool => $record->pivot->dispatched_at === null),
            ])
            ->toolbarActions([
                BulkActionGroup::make([
                    DetachBulkAction::make()
                        ->label('Remove selected assets'),
                ]),
            ]);
    }
Was this page helpful?