Cannot test a RelationManager

I'm trying to test a relation manager (to make sure some records are visible). As per documentation, I do a
livewire(EmployeesRelationManager::class)
livewire(EmployeesRelationManager::class)
and it worked correctly on v2. Now, on v3, it fails with the error
Filament\Resources\RelationManagers\RelationManager::getTitle(): Argument #2 ($pageClass) must be of type string, null given, called in .../vendor/filament/filament/src/Resources/RelationManagers/RelationManager.php on line 476
Filament\Resources\RelationManagers\RelationManager::getTitle(): Argument #2 ($pageClass) must be of type string, null given, called in .../vendor/filament/filament/src/Resources/RelationManagers/RelationManager.php on line 476
. I can't figure out how to solve or what I have to do since my EmployeesRelationManager is a simple RelationManager that only implements the form() and table() functions... Has this happened to anyone? How can I solve it?
Solution:
Sorry, my mistake. I was not passing the second argument "pageClass"... This is the correct code, if anyone is interested:
$page = livewire(EmployeesRelationManager::class, [
'ownerRecord' => $departments->get(0),
'pageClass' => ViewDepartmentDetails::class,
])
$page = livewire(EmployeesRelationManager::class, [
'ownerRecord' => $departments->get(0),
'pageClass' => ViewDepartmentDetails::class,
])
...
Jump to solution
1 Reply
Solution
marco.ferreira
marco.ferreira11mo ago
Sorry, my mistake. I was not passing the second argument "pageClass"... This is the correct code, if anyone is interested:
$page = livewire(EmployeesRelationManager::class, [
'ownerRecord' => $departments->get(0),
'pageClass' => ViewDepartmentDetails::class,
])
$page = livewire(EmployeesRelationManager::class, [
'ownerRecord' => $departments->get(0),
'pageClass' => ViewDepartmentDetails::class,
])