Fix debug bar getting loaded in production

This commit is contained in:
Dane Everitt 2017-11-04 14:21:30 -05:00
parent 167b22a320
commit 6a2cb72ede
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 15 additions and 16 deletions

View file

@ -1,20 +1,20 @@
<?php <?php
/**
* Pterodactyl - Panel
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
*
* This software is licensed under the terms of the MIT license.
* https://opensource.org/licenses/MIT
*/
namespace Pterodactyl\Providers; namespace Pterodactyl\Providers;
use View; use View;
use Cache; use Cache;
use Pterodactyl\Models; use Pterodactyl\Models\User;
use Pterodactyl\Observers; use Pterodactyl\Models\Server;
use Pterodactyl\Models\Subuser;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Pterodactyl\Observers\UserObserver;
use Pterodactyl\Observers\ServerObserver;
use Pterodactyl\Observers\SubuserObserver;
use Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider;
use DaneEveritt\LoginNotifications\NotificationServiceProvider;
use Barryvdh\Debugbar\ServiceProvider as DebugbarServiceProvider;
class AppServiceProvider extends ServiceProvider class AppServiceProvider extends ServiceProvider
{ {
@ -25,9 +25,9 @@ class AppServiceProvider extends ServiceProvider
{ {
Schema::defaultStringLength(191); Schema::defaultStringLength(191);
Models\User::observe(Observers\UserObserver::class); User::observe(UserObserver::class);
Models\Server::observe(Observers\ServerObserver::class); Server::observe(ServerObserver::class);
Models\Subuser::observe(Observers\SubuserObserver::class); Subuser::observe(SubuserObserver::class);
View::share('appVersion', $this->versionData()['version'] ?? 'undefined'); View::share('appVersion', $this->versionData()['version'] ?? 'undefined');
View::share('appIsGit', $this->versionData()['is_git'] ?? false); View::share('appIsGit', $this->versionData()['is_git'] ?? false);
@ -39,11 +39,12 @@ class AppServiceProvider extends ServiceProvider
public function register() public function register()
{ {
if ($this->app->environment() !== 'production') { if ($this->app->environment() !== 'production') {
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); $this->app->register(DebugbarServiceProvider::class);
$this->app->register(IdeHelperServiceProvider::class);
} }
if (config('pterodactyl.auth.notifications')) { if (config('pterodactyl.auth.notifications')) {
$this->app->register(\DaneEveritt\LoginNotifications\NotificationServiceProvider::class); $this->app->register(NotificationServiceProvider::class);
} }
} }

View file

@ -171,7 +171,6 @@ return [
/* /*
* Additional Dependencies * Additional Dependencies
*/ */
Barryvdh\Debugbar\ServiceProvider::class,
PragmaRX\Google2FA\Vendor\Laravel\ServiceProvider::class, PragmaRX\Google2FA\Vendor\Laravel\ServiceProvider::class,
igaster\laravelTheme\themeServiceProvider::class, igaster\laravelTheme\themeServiceProvider::class,
Prologue\Alerts\AlertsServiceProvider::class, Prologue\Alerts\AlertsServiceProvider::class,
@ -209,7 +208,6 @@ return [
'Cron' => Cron\CronExpression::class, 'Cron' => Cron\CronExpression::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class, 'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class, 'DB' => Illuminate\Support\Facades\DB::class,
'Debugbar' => Barryvdh\Debugbar\Facade::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class, 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class, 'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class, 'File' => Illuminate\Support\Facades\File::class,