diff --git a/src/Traits/WithDataTable.php b/src/Traits/WithDataTable.php index 1d52413..7c77bcf 100644 --- a/src/Traits/WithDataTable.php +++ b/src/Traits/WithDataTable.php @@ -9,4 +9,17 @@ trait WithDataTable use WithSorting; public $perPage = 10; + + public function pageName(): string + { + if (property_exists($this, 'pageName')) { + if (! isset($this->{$this->pageName})) { + $this->{$this->pageName} = 1; + } + + return $this->pageName; + } else { + return 'page'; + } + } }