Listing multiple values for a relationship with another attribute

I have a vehicle relation manager table where i want to display every IMEI numbers associated with the vehicle. On top of that, I want to format the imei list to include its' type as below.
"0185701241241 (Device)
  015830914194 (Addon)

Current code, obviously doesnt work:
Tables\Columns\TextColumn::make('deviceimeis.imei')
                    ->formatStateUsing(function ($state, Vehicle $record) {
                        return $state . '(' . $record->DeviceImeis->type . ')';
                    })
                    ->label('IMEI')
                    ->listWithLineBreaks()
                    ->bulleted(),
Was this page helpful?