feat: Implement configurable pagination options and deferred loading for all Filament tables.
This commit is contained in:
parent
dfef159634
commit
3578d7eaa9
@ -159,7 +159,9 @@ public static function table(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::Envelope)
|
||||
->emptyStateDescription('Belum ada kontak atau pesan masuk.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false);
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading();
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
|
||||
@ -299,6 +299,8 @@ public static function configure(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::HandRaised)
|
||||
->emptyStateDescription('Setelah Anda membuat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false);
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading();
|
||||
}
|
||||
}
|
||||
|
||||
@ -265,6 +265,8 @@ public static function table(Table $table): Table
|
||||
->emptyStateDescription('Belum ada permohonan perubahan data.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading()
|
||||
->modifyQueryUsing(function (Builder $query): void {
|
||||
$query->when(auth()->user()->hasRole(RoleEnum::PERUSAHAAN->value), function (Builder $q): Builder {
|
||||
return $q->where('user_id', auth()->id());
|
||||
|
||||
@ -208,6 +208,8 @@ public static function table(Table $table): Table
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading()
|
||||
->modifyQueryUsing(function (Builder $query): void {
|
||||
if (auth()->user()->hasRole(RoleEnum::PERUSAHAAN->value) && ! auth()->user()->company?->partnerMedia) {
|
||||
$query->whereRaw('1 = 0');
|
||||
|
||||
@ -341,6 +341,8 @@ public static function table(Table $table): Table
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading()
|
||||
->modifyQueryUsing(function (Builder $query): void {
|
||||
$query->role('Perusahaan')
|
||||
->whereHas('company');
|
||||
|
||||
@ -104,7 +104,9 @@ public static function table(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::ListBullet)
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false);
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading();
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
|
||||
@ -104,7 +104,9 @@ public static function table(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::BookOpen)
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false);
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading();
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
|
||||
@ -114,7 +114,9 @@ public static function table(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::BuildingLibrary)
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false);
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading();
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
|
||||
@ -104,7 +104,9 @@ public static function table(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::MapPin)
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false);
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading();
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
|
||||
@ -120,6 +120,8 @@ public static function table(Table $table): Table
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading()
|
||||
->groups([
|
||||
Group::make('classification.name')
|
||||
->label('Klasifikasi')
|
||||
|
||||
@ -116,6 +116,8 @@ public static function table(Table $table): Table
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading()
|
||||
->groups([
|
||||
Group::make('location.name')
|
||||
->label('Lokus')
|
||||
|
||||
@ -104,7 +104,9 @@ public static function table(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::PuzzlePiece)
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false);
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading();
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
|
||||
@ -170,7 +170,9 @@ public static function table(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::UserGroup)
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false);
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading();
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
|
||||
@ -199,6 +199,8 @@ public static function configure(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::ClipboardDocumentList)
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false);
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading();
|
||||
}
|
||||
}
|
||||
|
||||
@ -213,6 +213,8 @@ public static function configure(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::ExclamationCircle)
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false);
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading();
|
||||
}
|
||||
}
|
||||
|
||||
@ -224,6 +224,8 @@ public static function configure(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::ClipboardDocumentCheck)
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false);
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading();
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,7 +156,9 @@ public static function table(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::Megaphone)
|
||||
->emptyStateDescription('Setelah Anda membuat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false);
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading();
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
|
||||
@ -93,6 +93,8 @@ public static function configure(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::Newspaper)
|
||||
->emptyStateDescription('Setelah Anda membuat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false);
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading();
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,7 +102,9 @@ public static function table(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::ChartBar)
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('date', 'desc')
|
||||
->deferFilters(false);
|
||||
->deferFilters(false)
|
||||
->paginated([25, 50, 100, 'all'])
|
||||
->deferLoading();
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
|
||||
Loading…
Reference in New Issue
Block a user