Skip to content

Commit 64a7a5e

Browse files
committed
Tweak version checks
Whoops, See barryvdh#229
1 parent 60a9e4e commit 64a7a5e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/LaravelDebugBar.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public function __construct($app = null)
7272
$app = app(); //Fallback when $app is not given
7373
}
7474
$this->app = $app;
75+
$this->version = $app::VERSION;
7576
}
7677

7778
/**
@@ -756,6 +757,6 @@ public function addMessage($message, $label = 'info')
756757
*/
757758
protected function checkVersion($version, $operator = ">=")
758759
{
759-
return version_compare($this->app->version(), $version, $operator);
760+
return version_compare($this->version, $version, $operator);
760761
}
761762
}

src/ServiceProvider.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ function ($request, $response) use ($app) {
7474

7575
protected function shouldUseMiddleware()
7676
{
77-
$version = $this->app->version();
78-
return !$this->app->runningInConsole() && version_compare($version, '4.1-dev', '>=') && version_compare($version, '5.0-dev', '<');
77+
$app = $this->app;
78+
$version = $app::VERSION;
79+
return !$app->runningInConsole() && version_compare($version, '4.1-dev', '>=') && version_compare($version, '5.0-dev', '<');
7980
}
8081

8182
/**

0 commit comments

Comments
 (0)