From 76e819a2ec249360e134342d9af14f40dfef7b25 Mon Sep 17 00:00:00 2001 From: Moamen Eltouny <16774083+MoamenEltouny@users.noreply.github.com> Date: Wed, 13 Mar 2024 15:50:21 +0200 Subject: [PATCH] Update HasDevices.php --- src/Traits/HasDevices.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Traits/HasDevices.php b/src/Traits/HasDevices.php index 12b808a..00a3048 100644 --- a/src/Traits/HasDevices.php +++ b/src/Traits/HasDevices.php @@ -35,13 +35,9 @@ public function devicesWithAgents() * * @return array|null */ - public function getFcmListArrtibute() + public function getFcmListAttribute() { - $list = $this->devices()->whereNotNull('fcm_token')->where('logged_out', false)->get(); - if ($list->isEmpty()) - return null; - - return $list->pluck('fcm_token')->toArray(); + return $this->devices()->whereNotNull('fcm_token')->where('logged_out', false)->pluck('fcm_token')->toArray(); } /**