Skip to content

Commit

Permalink
Fix: Framework getByCode now accepts an array input
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsam726 committed Oct 19, 2023
1 parent 71f45b5 commit cf6a725
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Helpers/Framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public function getByCode(Model | string $model, string $code)
if (! Schema::hasColumn($model::query()->getModel()->getTable(), 'code')) {
return null;
}

if (is_array($code)) {
return $model::query()->whereIn('code', $code)->get();
}
return $model::query()->where('code', '=', trim($code))->first();
}

Expand Down

0 comments on commit cf6a725

Please sign in to comment.