mirror of
https://github.com/Cybrarist/Discount-Bandit.git
synced 2026-11-24 19:49:54 +01:00
40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Filament\Support\Facades\FilamentView;
|
|
use Filament\Tables\Enums\FiltersLayout;
|
|
use Filament\Tables\Enums\PaginationMode;
|
|
use Filament\Tables\Table;
|
|
use Filament\View\PanelsRenderHook;
|
|
use Illuminate\Support\HtmlString;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void {}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void {
|
|
|
|
Table::configureUsing(function (Table $table): void {
|
|
$table->filtersLayout(FiltersLayout::AboveContentCollapsible)
|
|
->paginationMode(PaginationMode::Cursor)
|
|
->paginationPageOptions([24, 48, 72, 96, 'all'])
|
|
->deferLoading()
|
|
;
|
|
});
|
|
|
|
FilamentView::registerRenderHook(
|
|
PanelsRenderHook::SCRIPTS_AFTER,
|
|
fn (): string => new HtmlString('<script>document.addEventListener("scroll-to-top", () => window.scrollTo(0, 0))</script>'),
|
|
);
|
|
|
|
}
|
|
}
|