Skip to content

Commit 63b4f3e

Browse files
committed
Merge branch 'lloricode-perpage' into develop
2 parents c99e835 + e70f92e commit 63b4f3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Traits/WithPerPagePagination.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function mountWithPerPagePagination(): void
2323
if (in_array(session()->get($this->tableName.'-perPage', $this->perPage), $this->perPageAccepted, true)) {
2424
$this->perPage = session()->get($this->tableName.'-perPage', $this->perPage);
2525
} else {
26-
$this->perPage = 10;
26+
$this->perPage = $this->perPageAccepted[0] ?? 10;
2727
}
2828
}
2929

@@ -35,7 +35,7 @@ public function updatedPerPage($value): void
3535
if (in_array(session()->get($this->tableName.'-perPage', $this->perPage), $this->perPageAccepted, true)) {
3636
session()->put($this->tableName.'-perPage', (int) $value);
3737
} else {
38-
session()->put($this->tableName.'-perPage', 10);
38+
session()->put($this->tableName.'-perPage', $this->perPageAccepted[0] ?? 10);
3939
}
4040

4141
$this->resetPage();

0 commit comments

Comments
 (0)