-
-
Notifications
You must be signed in to change notification settings - Fork 98
Open
Labels
Description
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?
Reactions are currently unavailable