PHP code example of happenv-com / filament-saved-views
1. Go to this page and download the library: Download happenv-com/filament-saved-views library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
happenv-com / filament-saved-views example snippets
use Happenv\FilamentSavedViews\FilamentSavedViewsPlugin;
$panel->plugin(FilamentSavedViewsPlugin::make());
use Happenv\FilamentSavedViews\Models\SavedView;
$this->app->bind(SavedView::class, \App\Models\MySavedView::class);
use Happenv\FilamentSavedViews\FilamentSavedViewsPlugin;
use Filament\Panel;
public function panel(Panel $panel): Panel
{
return $panel->plugin(FilamentSavedViewsPlugin::make());
}
use Happenv\FilamentSavedViews\Filament\Concerns\HasSavedViews;
class ListOrders extends ListRecords
{
use HasSavedViews;
}
public function getSubNavigation(): array
{
return $this->getSavedViewsNavigationItems();
}
use Happenv\FilamentSavedViews\Filament\Actions\SavedViewManagerAction;
SavedViewManagerAction::configureUsing(
fn (SavedViewManagerAction $action) => $action->color('primary')->badgeColor('warning'),
);
use Happenv\FilamentSavedViews\Filament\Enums\SavedViewManagerLayout;
use Filament\Actions\Action;
use Filament\Tables\Table;
public function table(Table $table): Table
{
return $table
// Dropdown (default) or Modal / slide-over presentation.
->savedViewManagerLayout(SavedViewManagerLayout::Modal)
// Customise the trigger button.
->savedViewManagerTriggerAction(fn (Action $action): Action => $action->slideOver())
// Stage changes and