20

Filament Tables TALL Stack Component

 3 years ago
source link: https://laravel-news.com/filament-tables-tall-stack-component
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Filament Tables TALL Stack Component

The Filament Table Builder is a TALL stack table component. You can use this table component as a standalone package, and it's also included with the Admin Panel.

Using the package's HasTable interface and InteractsWithTable trait, you can quickly build a table backed by an Eloquent query that you define:

1namespace App\Http\Livewire;
3use App\Models\Post;
4use Filament\Tables;
5use Illuminate\Contracts\View\View;
6use Illuminate\Database\Eloquent\Builder;
7use Livewire\Component;
9class ListPosts extends Component implements Tables\Contracts\HasTable
11 use Tables\Concerns\InteractsWithTable;
13 protected function getTableQuery(): Builder
15 return Post::query();
18 public function render(): View
20 return view('list-posts');

Beyond the basics, this package supports features that'll make implementing an interactive table with Livewire a cinch:

  • Customizable pagination
  • Record searching via Laravel Scout
  • Clickable rows
  • Empty state
  • Store table state in the query string
  • Table column types (text column, image column, boolean column, etc.)
  • Table filters
  • Table actions
  • Bulk actions

If you'd like to learn more about using the Filament Tables package with the TALL stack, check out the Table Builder documentation to get started!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK