Skip to content

faizananwerali/filament-refresh-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Filament Refresh Table

A Filament plugin that adds refresh functionality to tables.

Filament Refresh Table

Installation

You can install the package via composer:

composer require faizananwerali/filament-refresh-table

Usage

Global Usage

use FaizanAnwerAli\FilamentRefreshTable\FilamentRefreshTablePlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->plugins([
                FilamentRefreshTablePlugin::make(),
            ]);
    }
}

Manual Usage

use FaizanAnwerAli\FilamentRefreshTable\FilamentRefreshTablePlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->plugins([
                FilamentRefreshTablePlugin::make()->enabled(false),
            ]);
    }
}

On table page, use trait.

<?php

namespace App\Filament\Resources\PostResource\Pages;

use App\Filament\Resources\PostResource;
use FaizanAnwerAli\FilamentRefreshTable\Concerns\HasRefreshableTable;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;

class ListPosts extends ListRecords
{
    use HasRefreshableTable;
    
    protected static string $resource = PostResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Actions\CreateAction::make(),
        ];
    }
}

License

The MIT License (MIT).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published