first commit

This commit is contained in:
liu
2026-07-13 15:23:29 +08:00
commit 50885a98c8
473 changed files with 33772 additions and 0 deletions
@@ -0,0 +1,35 @@
<?php
namespace Modules\Common\Providers;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\ServiceProvider;
class PaginationProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
$this->app->bind('Illuminate\Pagination\LengthAwarePaginator', function ($app, $options) {
return new class(
$options['items'],
$options['total'],
$options['perPage'],
$options['currentPage'],
$options['options']
) extends LengthAwarePaginator {
public function toArray(): array
{
return [
'data' => $this->items(),
'total' => $this->total(),
'pageSize' => $this->perPage(),
'current' => $this->currentPage(),
];
}
};
});
}
}