jdavidbakr / mail-tracker

Package for Laravel to inject tracking code into outgoing emails.
MIT License
567 stars 129 forks source link

pagination limit not changeable #154

Closed lintaba closed 2 years ago

lintaba commented 2 years ago

default paginator have a pagination limit setting, however this does not affects the actual page size:

//AdminController@getIndex
        $emails = $query->paginate(config('mail-tracker.emails-per-page'));

it might be better to be sth like this (i can send a pr if needed):

        $emails = $query->paginate(request()->limit ?? config('mail-tracker.emails-per-page'));
jdavidbakr commented 2 years ago

I'm not sure of the context that this would be useful. The limit makes sense for an API response, but there's nothing in the UI that allows for the change in the limit. I would almost suggest making your own custom controller if you want to implement this additional functionality, since you would need to customize the UI as well.

lintaba commented 2 years ago

paginate gives back a lengthAwarePaginator, which when gets rendered (https://github.com/jdavidbakr/mail-tracker/blob/master/src/views/index.blade.php#L86) will show a fancy ui, with pages, and limit selector.

jdavidbakr commented 2 years ago

I'm going to close this - it should be easy enough to extend the AdminController class to customize as you need.