diff --git a/src/Model.php b/src/Model.php index 9f5b7a5..3e47fc5 100644 --- a/src/Model.php +++ b/src/Model.php @@ -887,7 +887,10 @@ public static function find(int $id, array|string $columns = '*', ?DataRulesInte $data = static::get($columns, fn ($query) => $query->where([$model->getKeyName() => $id]), $rules, $model); - return $data ? $data->first() : null; + if ($data->first() instanceof self) { + return $data; + } + return null; } /**