diff --git a/src/Kanvas/Companies/Repositories/CompaniesRepository.php b/src/Kanvas/Companies/Repositories/CompaniesRepository.php index 2f72f8f8a..3b6252c40 100644 --- a/src/Kanvas/Companies/Repositories/CompaniesRepository.php +++ b/src/Kanvas/Companies/Repositories/CompaniesRepository.php @@ -88,6 +88,10 @@ public static function userAssociatedToCompany(Companies $company, Users $user): */ public static function userAssociatedToCompanyAndBranch(Companies $company, CompaniesBranches $branch, Users $user): UsersAssociatedCompanies { + if ($user->isAppOwner()) { + return new UsersAssociatedCompanies(); + } + try { return UsersAssociatedCompanies::where('users_id', $user->getKey()) ->where('companies_id', $company->getKey())