F
Filament5mo ago
caglar

Infolist doesn't show the table on the browser

I'd like to use infolist in my project and I added it into my resource but it doesn't show any table on the browser. I don't get any error. Besides I'm using filament sidebar package. Can anybody help me?
24 Replies
Dennis Koch
Dennis Koch5mo ago
it doesn't show any table on the browser
Table? Infolists aren't tables. Share some info if you want help.
caglar
caglar5mo ago
I meant something like table, I couldn't see any data from infolist on the browser I just have this in my resource
public static function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
TextEntry::make('name'),
]);
}
public static function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
TextEntry::make('name'),
]);
}
Do you need some additional info?
ChesterS
ChesterS5mo ago
Do you have a view page?
public static function getPages(): array
{
return [
...
'view' => Pages\ViewMyModel::route('/{record}'),
];
}
public static function getPages(): array
{
return [
...
'view' => Pages\ViewMyModel::route('/{record}'),
];
}
caglar
caglar5mo ago
Yes I have.
ChesterS
ChesterS5mo ago
And what happens when you go to that page?
caglar
caglar5mo ago
I can see my widgets but I can not see my infolist
ChesterS
ChesterS5mo ago
can you share your getPages code and maybe some details about the resource?
caglar
caglar5mo ago
public static function getPages(): array
{
return [
...
'view' => Pages\ViewObject::route('/{record}'),
...
];
}
public static function getPages(): array
{
return [
...
'view' => Pages\ViewObject::route('/{record}'),
...
];
}
ChesterS
ChesterS5mo ago
The whole thing please. I'm wondering if you're overwritting some routes and not seeing the actual infolists page.
caglar
caglar5mo ago
My model name is AssetsObject
ChesterS
ChesterS5mo ago
Also I assume you're at least using v3 and everything else is correct Like you have the correct package installed etc.
caglar
caglar5mo ago
I'm using v3 I have installed Panel Builder
ChesterS
ChesterS5mo ago
My dude, I don't care what it's called, it's about trying to find what's wrong. The code you've copied looks correct, so there's something, somewhere that's not right so it doesn't work. 1) Does the model have a name attribute? 2) Are you sure you're hitting the correct route? 3) If you have a view page, you might need to move the infolist code there - if it's not already there add this
public function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
TextEntry::make('name'),
]);
}
public function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
TextEntry::make('name'),
]);
}
to the ViewObject class
caglar
caglar5mo ago
Object model have a name attribute I added suggested code into ViewObject page too Still doesn't show
ChesterS
ChesterS5mo ago
Can I see the whole getPages method and the whole ViewObject class?
caglar
caglar5mo ago
I'm sorry but it's company code so I can't share the whole stuff It's not allowed.
Dennis Koch
Dennis Koch5mo ago
Well, you need to ask someone in your company then 🤷 It's just some routes. 😅
ChesterS
ChesterS5mo ago
You can 'anonymize' it - make it generic but keep the logic. Sharing an infolist with a text entry for name says absolutely nothing about your project. Half my code has TextEntry::make('name') haha
caglar
caglar5mo ago
Thanks @ChesterS for your time and effort. It's appriciated.
caglar
caglar5mo ago
Here is AssetsObjectResource.php
caglar
caglar5mo ago
Here is ViewObject.php
caglar
caglar5mo ago
Dennis Koch
Dennis Koch5mo ago
Any reason you overwrote the $view file? Does it include the important parts from view-record.php?
caglar
caglar5mo ago
Yes you are correct! It's not needed. After removing it, the issue is fixed. Thanks a lot.