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