Get the item id in getRelations

I need to show the relation manager if the relation exists i have this code, and works but the id is fixed a 1 (for test) how do i get the item id? $this is not available
public static function getRelations(): array
{
$customer = Customer::find(1);
$repairs = $customer->repairs()->count();
$companies = $customer->companies()->count();
$relations = [];
if($repairs > 0) {
$relations[] = RelationManagers\RepairsRelationManager::Class;
}
if($companies > 0) {
$relations[] = RelationManagers\CompaniesRelationManager::Class;
}

return $relations;
}
public static function getRelations(): array
{
$customer = Customer::find(1);
$repairs = $customer->repairs()->count();
$companies = $customer->companies()->count();
$relations = [];
if($repairs > 0) {
$relations[] = RelationManagers\RepairsRelationManager::Class;
}
if($companies > 0) {
$relations[] = RelationManagers\CompaniesRelationManager::Class;
}

return $relations;
}
2 Replies
MartinKnops
MartinKnops7mo ago
did you fix the problem? the same issue over here
Soundmit
Soundmit7mo ago
nope, i still show the empty relations
Want results from more Discord servers?
Add your server