phpvms/app/Providers/AppServiceProvider.php

43 lines
1.3 KiB
PHP
Raw Normal View History

2017-06-09 02:28:26 +08:00
<?php
2017-06-09 02:28:26 +08:00
namespace App\Providers;
use App\Services\ModuleService;
use App\Support\Utils;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\View;
2017-06-09 02:28:26 +08:00
use Illuminate\Support\ServiceProvider;
2017-06-09 02:28:26 +08:00
class AppServiceProvider extends ServiceProvider
{
public function boot(): void
2017-06-09 02:28:26 +08:00
{
Schema::defaultStringLength(191);
Paginator::useBootstrap();
View::share('moduleSvc', app(ModuleService::class));
2017-06-09 02:28:26 +08:00
}
/**
* Register any application services.
*/
public function register(): void
2017-06-09 02:28:26 +08:00
{
// Only load the IDE helper if it's included and enabled
if (config('app.debug') === true) {
2018-08-27 02:51:47 +08:00
/* @noinspection NestedPositiveIfStatementsInspection */
/* @noinspection PhpFullyQualifiedNameUsageInspection */
if (class_exists(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class)) {
/* @noinspection PhpFullyQualifiedNameUsageInspection */
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
}
if (config('app.debug_toolbar') === true) {
Utils::enableDebugToolbar();
} else {
Utils::disableDebugToolbar();
}
}
2017-06-09 02:28:26 +08:00
}
}