class SolarwindsMobileByModelTable extends BaseWidget
{
public function getTableRecordKey(Model $record): string
{
return 'model';
}
public function table(Table $table): Table
{
return $table
->query(
SolarwindsMobile::selectRaw('model, COUNT(*) as count')
->where('device_type', 'iPhone')
->orWhere('device_type', 'Phone')
->groupBy('model')
->orderBy('model')
)
->columns([
Tables\Columns\TextColumn::make('model')
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('count')
->sortable()
]);
}
class SolarwindsMobileByModelTable extends BaseWidget
{
public function getTableRecordKey(Model $record): string
{
return 'model';
}
public function table(Table $table): Table
{
return $table
->query(
SolarwindsMobile::selectRaw('model, COUNT(*) as count')
->where('device_type', 'iPhone')
->orWhere('device_type', 'Phone')
->groupBy('model')
->orderBy('model')
)
->columns([
Tables\Columns\TextColumn::make('model')
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('count')
->sortable()
]);
}