Skip to content

Commit

Permalink
Fix getExternalProductItem for softdeletes models
Browse files Browse the repository at this point in the history
  • Loading branch information
ThijsLacquet committed Oct 27, 2024
1 parent 7158247 commit eca9af1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Http/Controllers/CashRegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ protected function getExternalProductItem(string $type, int $id): HasExternalPro
: ['*'];

/** @var HasExternalProductItem&Model $productItem */
if (method_exists($type, 'withThrashed')) {


if (method_exists($type, 'bootSoftDeletes')) {
$productItem = $type::withTrashed()->findOrFail($id, $columns);
} else {
$productItem = $type::findOrFail($id, $columns);
Expand Down

0 comments on commit eca9af1

Please sign in to comment.