AppServiceProvider.php 706 字节
<?php

namespace App\Providers;

use App\Services\PaginatorServer;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //自定义分页
        $this->app->bind('Illuminate\Pagination\LengthAwarePaginator',function ($app,$options){
            return new PaginatorServer($options['items'], $options['total'], $options['perPage'], $options['currentPage'] , $options['options']);
        });
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }
}