Skip to content

Commit

Permalink
fix find method return type issue
Browse files Browse the repository at this point in the history
  • Loading branch information
BMTmohammedtaha committed Dec 6, 2023
1 parent 9173146 commit 21592d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 21592d9

Please sign in to comment.