diff --git a/app/Filament/Resources/DeviceMasterResource.php b/app/Filament/Resources/DeviceMasterResource.php index 108b765a4..53e70d02a 100644 --- a/app/Filament/Resources/DeviceMasterResource.php +++ b/app/Filament/Resources/DeviceMasterResource.php @@ -54,10 +54,14 @@ class DeviceMasterResource extends Resource { return $table ->columns([ - Tables\Columns\TextColumn::make('id') - ->label('ID') - ->numeric() - ->sortable(), + Tables\Columns\TextColumn::make('No.') + ->label('No.') + ->getStateUsing(function ($record, $livewire, $column, $rowLoop) { + $paginator = $livewire->getTableRecords(); + $perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10; + $currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1; + return ($currentPage - 1) * $perPage + $rowLoop->iteration; + }), Tables\Columns\TextColumn::make('plant.name') ->label('Plant') ->alignCenter() diff --git a/app/Filament/Resources/MfmMeterResource.php b/app/Filament/Resources/MfmMeterResource.php index e6934fa23..00898d8fa 100644 --- a/app/Filament/Resources/MfmMeterResource.php +++ b/app/Filament/Resources/MfmMeterResource.php @@ -66,10 +66,14 @@ class MfmMeterResource extends Resource { return $table ->columns([ - Tables\Columns\TextColumn::make('id') - ->label('ID') - ->numeric() - ->sortable(), + Tables\Columns\TextColumn::make('No.') + ->label('No.') + ->getStateUsing(function ($record, $livewire, $column, $rowLoop) { + $paginator = $livewire->getTableRecords(); + $perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10; + $currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1; + return ($currentPage - 1) * $perPage + $rowLoop->iteration; + }), Tables\Columns\TextColumn::make('plant.name') ->label('Plant') ->sortable(), diff --git a/app/Filament/Resources/MfmParameterResource.php b/app/Filament/Resources/MfmParameterResource.php index 73568cf0d..9c28cafac 100644 --- a/app/Filament/Resources/MfmParameterResource.php +++ b/app/Filament/Resources/MfmParameterResource.php @@ -73,10 +73,14 @@ class MfmParameterResource extends Resource { return $table ->columns([ - Tables\Columns\TextColumn::make('id') - ->label('ID') - ->numeric() - ->sortable(), + Tables\Columns\TextColumn::make('No.') + ->label('No.') + ->getStateUsing(function ($record, $livewire, $column, $rowLoop) { + $paginator = $livewire->getTableRecords(); + $perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10; + $currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1; + return ($currentPage - 1) * $perPage + $rowLoop->iteration; + }), Tables\Columns\TextColumn::make('plant.name') ->label('Plant') ->alignCenter() diff --git a/app/Filament/Resources/MfmReadingResource.php b/app/Filament/Resources/MfmReadingResource.php index d051c386c..4beb7a33d 100644 --- a/app/Filament/Resources/MfmReadingResource.php +++ b/app/Filament/Resources/MfmReadingResource.php @@ -60,11 +60,14 @@ class MfmReadingResource extends Resource { return $table ->columns([ - Tables\Columns\TextColumn::make('id') - ->label('ID') - ->alignCenter() - ->numeric() - ->sortable(), + Tables\Columns\TextColumn::make('No.') + ->label('No.') + ->getStateUsing(function ($record, $livewire, $column, $rowLoop) { + $paginator = $livewire->getTableRecords(); + $perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10; + $currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1; + return ($currentPage - 1) * $perPage + $rowLoop->iteration; + }), Tables\Columns\TextColumn::make('plant.name') ->label('Plant') ->alignCenter() diff --git a/app/Filament/Resources/TempLiveReadingResource.php b/app/Filament/Resources/TempLiveReadingResource.php index 9c8bdb9bb..85f9dfca4 100644 --- a/app/Filament/Resources/TempLiveReadingResource.php +++ b/app/Filament/Resources/TempLiveReadingResource.php @@ -62,10 +62,14 @@ class TempLiveReadingResource extends Resource { return $table ->columns([ - Tables\Columns\TextColumn::make('id') - ->label('ID') - ->numeric() - ->sortable(), + Tables\Columns\TextColumn::make('No.') + ->label('No.') + ->getStateUsing(function ($record, $livewire, $column, $rowLoop) { + $paginator = $livewire->getTableRecords(); + $perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10; + $currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1; + return ($currentPage - 1) * $perPage + $rowLoop->iteration; + }), Tables\Columns\TextColumn::make('plant.name') ->numeric() ->sortable(),