infolist not woking?
I am using infolist on a custom page but the model is not loading.
Page
Page
class AccountStatements extends Page implements HasForms, HasTable, HasInfolists
{
use InteractsWithForms;
use InteractsWithTable;
use InteractsWithInfolists;
protected static ?string $navigationIcon = 'heroicon-o-cog-8-tooth';
protected static ?string $navigationGroup = 'Reports';
protected static string $view = 'filament.pages.reports.accountStatement';
protected $listeners = [
'update_table' => '$refresh',
];
public $account = null;
public function table(Table $table): Table
{
return $table
->query(ModelAccountStatement::queryAccount($this->account))
->columns([
TextColumn::make('transaction_no')->sortable(false),
// more data
])->filters([
SelectFilter::make('account')
->searchable(true)
->options(Account::query()->pluck('name', 'id')->toArray())
->columnSpan(2)
->query(
function ($data) {
if ($data['value'] != $this->account) {
$this->account = $data['value'];
$this->dispatch('update_table');
}
return null;
}
),
], layout: FiltersLayout::AboveContent)
->actions([
Tables\Actions\ViewAction::make(),
])
->emptyStateActions([]);
}
public static function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
TextEntry::make('transaction_no'),
// more data
]);
}
}class AccountStatements extends Page implements HasForms, HasTable, HasInfolists
{
use InteractsWithForms;
use InteractsWithTable;
use InteractsWithInfolists;
protected static ?string $navigationIcon = 'heroicon-o-cog-8-tooth';
protected static ?string $navigationGroup = 'Reports';
protected static string $view = 'filament.pages.reports.accountStatement';
protected $listeners = [
'update_table' => '$refresh',
];
public $account = null;
public function table(Table $table): Table
{
return $table
->query(ModelAccountStatement::queryAccount($this->account))
->columns([
TextColumn::make('transaction_no')->sortable(false),
// more data
])->filters([
SelectFilter::make('account')
->searchable(true)
->options(Account::query()->pluck('name', 'id')->toArray())
->columnSpan(2)
->query(
function ($data) {
if ($data['value'] != $this->account) {
$this->account = $data['value'];
$this->dispatch('update_table');
}
return null;
}
),
], layout: FiltersLayout::AboveContent)
->actions([
Tables\Actions\ViewAction::make(),
])
->emptyStateActions([]);
}
public static function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
TextEntry::make('transaction_no'),
// more data
]);
}
}