From afaebf920a45c4700face9e804cc478b22649be6 Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Thu, 9 Jan 2025 17:56:20 +0330 Subject: [PATCH] Update CanOwn.php --- src/Foundation/Support/Traits/Model/CanOwn.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Foundation/Support/Traits/Model/CanOwn.php b/src/Foundation/Support/Traits/Model/CanOwn.php index 6044e6c7..e6149175 100644 --- a/src/Foundation/Support/Traits/Model/CanOwn.php +++ b/src/Foundation/Support/Traits/Model/CanOwn.php @@ -40,17 +40,17 @@ public function isOwnedBy(Model $owner, string|null $relation = null): bool public function owns(Model $ownable, string|null $relation = null): bool { if ($relation) { - return null !== $this->$relation()->find($ownable); + return !is_null($this->$relation()->find($ownable)); } $relation = $this->guessSingularRelationshipName($ownable); if (method_exists($this, $relation)) { - return null !== $this->$relation()->find($ownable); + return !is_null($this->$relation()->find($ownable)); } $relation = $this->guessPluralRelationshipName($ownable); if (method_exists($this, $relation)) { - return null !== $this->$relation()->find($ownable); + return !is_null($this->$relation()->find($ownable)); } throw new InternalError('No relationship found. Please pass the relationship name as the second parameter.');