Option to set default table pagination

Hi,

I'm creating some tables that have plenty data in them. I have pagination enabled with the default options of [5, 10, 25, 50, 'all']
  • I'd like to keep those options, but default the view to 25 rather than 10.
ooking at CanPaginateRecords I can see the below method, but it seems that we either show 10 rows if it's in the options array, otherwise we just use the first item. I could override the default options and change 10 to 9 or 11, but that doesn't feel right.

 public function getDefaultPaginationPageOption(): int | string | null
  {
      $option = $this->evaluate($this->defaultPaginationPageOption);

      if ($option) {
          return $option;
      }

      $options = $this->getPaginationPageOptions();

      if (in_array(10, $options)) {
          return 10;
      }

      return Arr::first($options);
  }


Is there a way that I can get round this? Or request it as a feature in a future release?

Cheers

Adam
Was this page helpful?