Skip to content

Commit

Permalink
Check if session is bound
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh committed Jan 2, 2016
1 parent 355bf5b commit 4cedec8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php namespace Barryvdh\Debugbar;

use Illuminate\Routing\Router;
use Illuminate\Session\SessionManager;

class ServiceProvider extends \Illuminate\Support\ServiceProvider
{
Expand Down Expand Up @@ -29,9 +30,11 @@ public function register()
$this->app->singleton('debugbar', function ($app) {
$debugbar = new LaravelDebugbar($app);

$sessionManager = $app['session'];
$httpDriver = new SymfonyHttpDriver($sessionManager);
$debugbar->setHttpDriver($httpDriver);
if ($app->bound(SessionManager::class)) {
$sessionManager = $app->make(SessionManager::class);
$httpDriver = new SymfonyHttpDriver($sessionManager);
$debugbar->setHttpDriver($httpDriver);
}

return $debugbar;
}
Expand Down

0 comments on commit 4cedec8

Please sign in to comment.