mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-12 23:48:53 +00:00
- Unify pagination and total footer layout - Improve pagination display on small screens (no overflow) - Add truncated pagination with ellipsis - Standardize paginator style (Bootstrap 4)
49 lines
1.3 KiB
PHP
49 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use DB;
|
|
use File;
|
|
use Illuminate\Pagination\Paginator;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Schema;
|
|
use URL;
|
|
|
|
use function config;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
if ($this->app->isLocal() && config('app.debug')) {
|
|
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
|
|
$this->app->register(\Barryvdh\Debugbar\ServiceProvider::class);
|
|
|
|
if (class_exists(\Laravel\Telescope\TelescopeServiceProvider::class)) {
|
|
$this->app->register(\Laravel\Telescope\TelescopeServiceProvider::class);
|
|
$this->app->register(TelescopeServiceProvider::class);
|
|
}
|
|
}
|
|
|
|
if (Schema::hasTable('config') && File::exists(base_path().'/.env') && DB::table('config')->exists()) {
|
|
$this->app->register(SettingServiceProvider::class);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
Paginator::useBootstrapFour();
|
|
|
|
// 检测是否强制跳转https
|
|
if (config('session.secure')) {
|
|
URL::forceScheme('https');
|
|
}
|
|
}
|
|
}
|