Filters Outside
This example shows Filters "Outside".
(This Table is a variation of the "Filter Inline" example.)
ID
Dish
Calories
Category
Chef
Price
Diet
In Stock
Created At
ID
|
Dish
|
Calories
|
Category
|
Chef
|
Price
|
Diet
|
In Stock
|
Created At
|
---|---|---|---|---|---|---|---|---|
1
|
Arkansas Possum Pie
|
653 kcal
|
Meat
|
R$Β 216,61
|
π₯ Suitable for Celiacs
|
In Stock
|
30/08/2024
|
|
2
|
Albacore Tuna Melt
|
266 kcal
|
Soup
|
Vitor
|
R$Β 89,93
|
π± Suitable for Vegans
|
In Stock
|
13/08/2024
|
3
|
Π±ΠΎΡΡ
|
402 kcal
|
Soup
|
Dan
|
R$Β 100,19
|
π₯ Suitable for Celiacs
|
In Stock
|
08/08/2024
|
4
|
Bacalhau com natas
|
164 kcal
|
Garnish
|
Luan
|
R$Β 112,80
|
π₯ Suitable for Celiacs
|
In Stock
|
21/07/2024
|
5
|
Baba Ghanoush
|
534 kcal
|
Pasta
|
R$Β 115,97
|
π± Suitable for Vegans
|
Out of Stock
|
13/08/2024
|
|
6
|
Bacon Cheeseburger
|
101 kcal
|
Soup
|
R$Β 269,54
|
π½οΈ All diets
|
In Stock
|
16/08/2024
|
|
7
|
Baked potato
|
272 kcal
|
Pasta
|
Claudio
|
R$Β 167,11
|
π½οΈ All diets
|
In Stock
|
07/08/2024
|
8
|
Baklava
|
493 kcal
|
Dessert
|
R$Β 74,52
|
π₯ Suitable for Celiacs
|
In Stock
|
21/08/2024
|
|
9
|
Bangers and mash
|
159 kcal
|
Soup
|
R$Β 268,73
|
π₯ Suitable for Celiacs
|
In Stock
|
29/07/2024
|
|
10
|
Black Pudding
|
723 kcal
|
Soup
|
R$Β 272,01
|
π± Suitable for Vegans
|
In Stock
|
16/07/2024
|
Disclaimer: Table data is randomly generated for
illustrative purposes only. The information here is not a reflection of the actual market and does
not constitute business, financial, or medical advice.
<?php namespace App\Livewire\Examples\FiltersOutsideTable; use App\Livewire\Examples\FiltersInlineTable\FiltersInlineTable;use App\Models\Dish;use Illuminate\Database\Eloquent\Builder;use PowerComponents\LivewirePowerGrid\Facades\PowerGrid; final class FiltersOutsideTable extends FiltersInlineTable{ public bool $showFilters = true; public function boot(): void { config(['livewire-powergrid.filter' => 'outside']); } public function setUp(): array { return [ PowerGrid::header() ->showToggleColumns() ->withoutLoading() ->showSearchInput(), PowerGrid::footer() ->showPerPage() ->showRecordCount(), ]; } public function datasource(): Builder { return Dish::query() ->when( $this->categoryId, fn ($builder) => $builder->whereHas( 'category', fn ($builder) => $builder->where('category_id', $this->categoryId) ) ->with(['category', 'kitchen']) ); }}
Code highlighting provided by Torchlight.dev