File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -33,16 +33,20 @@ public function bootingPackage()
33
33
{
34
34
$ this ->app ->singleton (CustomsFieldsMigrators::class, CustomFieldsMigrator::class);
35
35
36
- if (Utils::isTenantEnabled () && $ tenantModel = Filament::getTenantModel ()) {
37
- $ tenantModelInstance = app ($ tenantModel );
38
-
39
- CustomField::resolveRelationUsing ('team ' , function (CustomField $ customField ) use ($ tenantModel ) {
40
- return $ customField ->belongsTo ($ tenantModel , config ('custom-fields.column_names.tenant_foreign_key ' ));
41
- });
42
-
43
- $ tenantModelInstance ->resolveRelationUsing ('customFields ' , function (Model $ tenantModel ) {
44
- return $ tenantModel ->hasMany (CustomField::class, config ('custom-fields.column_names.tenant_foreign_key ' ));
45
- });
36
+ if (Utils::isTenantEnabled ()) {
37
+ foreach (Filament::getPanels () as $ panel ) {
38
+ if ($ tenantModel = $ panel ->getTenantModel ()) {
39
+ $ tenantModelInstance = app ($ tenantModel );
40
+
41
+ CustomField::resolveRelationUsing ('team ' , function (CustomField $ customField ) use ($ tenantModel ) {
42
+ return $ customField ->belongsTo ($ tenantModel , config ('custom-fields.column_names.tenant_foreign_key ' ));
43
+ });
44
+
45
+ $ tenantModelInstance ->resolveRelationUsing ('customFields ' , function (Model $ tenantModel ) {
46
+ return $ tenantModel ->hasMany (CustomField::class, config ('custom-fields.column_names.tenant_foreign_key ' ));
47
+ });
48
+ }
49
+ }
46
50
}
47
51
}
48
52
You can’t perform that action at this time.
0 commit comments