F
Filament3mo ago
Tieme

Relationmanager in Livewire Infolist component

Hi All, I'm trying to get a realtionmanager in a infolist livewire component.
Infolists\Components\Livewire::make(VaccinesRelationManager::class)
->key('vaccines-table')
->lazy(),
Infolists\Components\Livewire::make(VaccinesRelationManager::class)
->key('vaccines-table')
->lazy(),
When i do this i get following error.
Typed property Filament\Resources\RelationManagers\RelationManager::$ownerRecord must not be accessed before initialization
Typed property Filament\Resources\RelationManagers\RelationManager::$ownerRecord must not be accessed before initialization
Is there anyway to do this without defining it in the below function on the resource? The reason i don't want to have it in below function is that the Infolist has tabs lay-out and need the table in one of the tabs. I know i can make my own livewire component, but a relationmanager has all the functions that i need.
public static function getRelations(): array
{
return [
];
}
public static function getRelations(): array
{
return [
];
}
Thanks for you help.
Solution:
Thanks for the reaction. If anyone has the same question i found a solution by implementing the following plugin. With that plugin you can add the relation manager into a infolist / form. ...
GitHub
GitHub - njxqlus/filament-relation-manager-component: Use Filament ...
Use Filament Relation Manager Everywhere! Contribute to njxqlus/filament-relation-manager-component development by creating an account on GitHub.
Jump to solution
6 Replies
Tieme
Tieme3mo ago
up
krekas
krekas3mo ago
maybe this would help
krekas
krekas3mo ago
GitHub
Relation Manager above form / infolist? · filamentphp filament · Di...
I'm sure I've done this before but I can't see any reference to it in the docs. How can I position my relation managers in getRelations() to be positioned at the top of the view/edit pa...
Dennis Koch
Dennis Koch3mo ago
When i do this i get following error.
Relation managers need to know the Owner Record. I don't think there is a way to set this other than the mount of the component.
Solution
Tieme
Tieme3mo ago
Thanks for the reaction. If anyone has the same question i found a solution by implementing the following plugin. With that plugin you can add the relation manager into a infolist / form. https://github.com/njxqlus/filament-relation-manager-component
GitHub
GitHub - njxqlus/filament-relation-manager-component: Use Filament ...
Use Filament Relation Manager Everywhere! Contribute to njxqlus/filament-relation-manager-component development by creating an account on GitHub.
Clay Bitner
Clay Bitner3mo ago
I just tried this plugin - works great locally, but can't seem to get it to work when releasing through Vapor. Not sure if there's some extra config needed.