Skip to content

Commit

Permalink
fix forceReplace macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Marius committed Dec 4, 2024
1 parent 87b91eb commit f11e29d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Providers/CrudProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function (...$arguments): Model {
Request::macro('forceOffsetUnset', function (string $offset): Request {
/** @var Request $this */

if ($this->isJson()) {
if ($this->json()->count() > 0) {
$this->json()->remove($offset);
}

Expand All @@ -60,7 +60,7 @@ function (...$arguments): Model {
Request::macro('forceReplace', function (array $data): Request {
/** @var Request $this */

if ($this->json()->count() > 0) {
if ($this->isJson()) {
$this->json()->replace($data);
}

Expand Down

0 comments on commit f11e29d

Please sign in to comment.