phpvms/app/Providers/AppServiceProvider.php
Nabeel S 4a14e83c88
Performance improvements #602 (#607)
* Update gitignore

* Save theme to the session to avoid a lookup #602

* Formatting

* Move routes into main service provider

* Move Observers into their own service provider
2020-03-01 15:51:00 -05:00

41 lines
1.2 KiB
PHP
Executable File

<?php
namespace App\Providers;
use App\Services\ModuleService;
use App\Support\Utils;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
Schema::defaultStringLength(191);
View::share('moduleSvc', app(ModuleService::class));
}
/**
* Register any application services.
*/
public function register(): void
{
// Only load the IDE helper if it's included and enabled
if (config('app.debug') === true) {
/* @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();
}
}
}
}