Skip to content

Customizable items per page pagination in admin interface #104

@damarev

Description

@damarev

Currently items per page pagination in admin interface is harcoded in controllers to 100 items per page (ChannelController, OrderController, ProductController and PropertyController), which seems a little bit too much.

It would be nice to have this value configurable, I see two possible approches:

Option 1. Via a config setting in config/concord.php, like:

return [
    'modules' => [
        Vanilo\Framework\Providers\ModuleServiceProvider::class => [
            'pagination' => [
                'order' => 25,
            ],
        ],
    ]
];

and then in src/Http/Controllers/OrderController.php

return view('vanilo::order.index', [
    'orders' => $query->paginate(config('vanilo.framework.pagination.order',100)),
    'inactives' => $inactives,
]);

Option 2. Or maybe a simpler and global solution would be to just use the default eloquent pagination of 15 items:

return view('vanilo::order.index', [
    'orders' => $query->paginate(),
    'inactives' => $inactives,
]);

And override this seeting via custom model as described in documentation:

namespace App;

use Vanilo\Framework\Models\Order as BaseOrder;

class Order extends BaseOrder 
{
    protected $perPage = 25;
}

How does that sound?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions