F
Filamentβ€’7mo ago
Husky110

Table-Widget-Problem (call to a member function table() on string)

Hi - I'm having trouble setting up a table-widget. I've created the widget via php artisan make:filament-widget ArticleStocksWidget --table, linked it to the ArticleResource and marked "The [console] panel". I've registered the widget within the resource and added it to the getHeaderWidgets in my "ViewArticle"-Page. When I try to display said widget, I get a blank space where it should be and then the display-error "call to a member function table() on string" pointing to my ->columns-method. My table-function looks like this:
public function table(Table $table): Table
{
return $table
->query(FrontendCacheReservedStocks::query())
->columns([
'fulfiller_id',
'stockcount',
]);
}
public function table(Table $table): Table
{
return $table
->query(FrontendCacheReservedStocks::query())
->columns([
'fulfiller_id',
'stockcount',
]);
}
FrontendCacheReservedStocks is a regular Model. Anyone have a clue on where to look here?
Solution:
You should pass columns to the array ```php ->columns([ TextColumn::make('fulfiller_id') ......
Jump to solution
3 Replies
Solution
LeandroFerreira
LeandroFerreiraβ€’7mo ago
You should pass columns to the array
->columns([
TextColumn::make('fulfiller_id')
...
])
->columns([
TextColumn::make('fulfiller_id')
...
])
Husky110
Husky110OPβ€’7mo ago
πŸ€¦β€β™‚οΈ - of course! Own stupidity! πŸ˜… Thank you!
LeandroFerreira
LeandroFerreiraβ€’7mo ago
no problem, it happens ✌️
Want results from more Discord servers?
Add your server