Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
nikuscs authored and github-actions[bot] committed Nov 25, 2022
1 parent 6d3220c commit 18a78ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/Core/Option/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,14 @@ public function toArray(): array
$this->disabledKey => $this->isDisabled(),
$this->childrenKey => $this->getChildrenToArray(),
])
->filter(function ($value,$key) {
if($key === $this->childrenKey) {
return !empty($value);
->filter(function ($value, $key) {
if ($key === $this->childrenKey) {
return ! empty($value);
}
if($key === $this->disabledKey && $value === false) {
if ($key === $this->disabledKey && $value === false) {
return false;
}

return true;
})
->toArray();
Expand Down
1 change: 1 addition & 0 deletions src/Datatables/Actions/Concerns/CanRefresh.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ trait CanRefresh
public function refreshAfterExecuted(bool | Closure $refresh = false): static
{
$this->after['refresh'] = $this->evaluate($refresh);

return $this;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Datatables/Http/Payload/Concerns/HasModels.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function resolveModels(): void
throw_if(empty($primaryKey), new DatatableUnableToResolveModelPrimaryKeyException());

// Not all selected and not selected rows at all
if(!$this->isAllSelected() && !$this->hasSelectedRows()) {
if (! $this->isAllSelected() && ! $this->hasSelectedRows()) {
return;
}

Expand All @@ -46,7 +46,7 @@ public function resolveModels(): void
$this
->getQuery()
->clone()
->when(!$this->isAllSelected(), fn($query) => $query->whereIn($primaryKey, $this->getSelectedRowsIds()))
->when(! $this->isAllSelected(), fn ($query) => $query->whereIn($primaryKey, $this->getSelectedRowsIds()))
->get() ?? Collection::make()
);
}
Expand Down

0 comments on commit 18a78ae

Please sign in to comment.