diff --git a/extend/catcher/traits/db/ScopeTrait.php b/extend/catcher/traits/db/ScopeTrait.php index 4eb097d..3a7dd64 100644 --- a/extend/catcher/traits/db/ScopeTrait.php +++ b/extend/catcher/traits/db/ScopeTrait.php @@ -23,7 +23,7 @@ trait ScopeTrait */ public function scopeCreator($query) { - if (in_array('creator_id', $this->field)) { + if (property_exists($this, 'field') && in_array('creator_id', $this->field)) { return $query->addSelectSub(function () { $user = app(Users::class); return $user->whereColumn($this->getTable() . '.creator_id', $user->getTable() . '.id')