phpvms/app/Providers/AppServiceProvider.php
Nabeel S 3800c01d94
Update to Laravel 8 (#1058)
* Update Laravel and other dependencies

* Composer version in CI

* Remove the PHP exit from env file

* Add PHP 8 to testing matrix

* Update doctrine

* Update doctrine

* Update faker lib

* Rewrite TLD check to remove deprecated library

* Update version lib

* Remove PHP 8 for now

* Style fixes
2021-03-04 17:08:51 -05:00

43 lines
1.3 KiB
PHP
Executable File

<?php
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;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
Schema::defaultStringLength(191);
Paginator::useBootstrap();
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();
}
}
}
}