From 3b6a24f08e41c92d617fb71d4bfda9c6d5d08a22 Mon Sep 17 00:00:00 2001 From: Pete Cooper Date: Fri, 2 Oct 2020 10:13:20 +0100 Subject: [PATCH] update to an if/else --- src/Commands/TenantList.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Commands/TenantList.php b/src/Commands/TenantList.php index 7c7248b5..493b5a93 100644 --- a/src/Commands/TenantList.php +++ b/src/Commands/TenantList.php @@ -35,10 +35,11 @@ class TenantList extends Command ->query() ->cursor() ->each(function (Tenant $tenant) { - $this->line( - "[Tenant] id: {$tenant['id']}" . - ($tenant->domains ? ' @ ' . implode('; ', $tenant->domains->pluck('domain')->toArray() ?? []) : '') - ); + if ($tenant->domains) { + $this->line("[Tenant] id: {$tenant['id']} @ " . implode('; ', $tenant->domains->pluck('domain')->toArray() ?? [])); + } else { + $this->line("[Tenant] id: {$tenant['id']}"); + } }); } }