1234567891011121314151617181920212223242526272829 |
- <?php
- namespace App\Providers;
- use App\Tools\ApiPaginator;
- use Illuminate\Pagination\LengthAwarePaginator;
- use Illuminate\Support\ServiceProvider;
- class AppServiceProvider extends ServiceProvider
- {
- /**
- * Register any application services.
- */
- public function register(): void
- {
- //
- }
- /**
- * Bootstrap any application services.
- */
- public function boot(): void
- {
- //
- $this->app->bind(LengthAwarePaginator::class, function ($app, $options) {
- return new ApiPaginator($options['items'], $options['total'], $options['perPage'], $options['currentPage'], $options['options']);
- });
- }
- }
|