@@ -72,11 +72,6 @@ public function __construct($app = null)
72
72
$ app = app (); //Fallback when $app is not given
73
73
}
74
74
$ this ->app = $ app ;
75
-
76
- //Normalize Laravel version
77
- $ version = $ app ::VERSION ;
78
- list ($ version ) = explode ('- ' , $ version );
79
- $ this ->version = $ version ;
80
75
}
81
76
82
77
/**
@@ -133,7 +128,7 @@ function () use ($debugbar, $startTime) {
133
128
);
134
129
135
130
//Check if App::before is already called..
136
- if ($ this ->checkVersion ('4.1 ' ) && $ this ->app ->isBooted ()) {
131
+ if ($ this ->checkVersion ('4.1-dev ' , ' >= ' ) && $ this ->app ->isBooted ()) {
137
132
$ debugbar ->startMeasure ('application ' , 'Application ' );
138
133
} else {
139
134
$ this ->app ['router ' ]->before (
@@ -160,7 +155,7 @@ function () use ($debugbar) {
160
155
$ this ->app ['config ' ]->get ('laravel-debugbar::config.options.exceptions.chain ' , true )
161
156
);
162
157
$ this ->addCollector ($ exceptionCollector );
163
- if ($ this ->checkVersion ('5.0 ' , '< ' )) {
158
+ if ($ this ->checkVersion ('5.0-dev ' , '< ' )) {
164
159
$ this ->app ->error (
165
160
function (Exception $ exception ) use ($ exceptionCollector ) {
166
161
$ exceptionCollector ->addException ($ exception );
@@ -216,7 +211,7 @@ function ($view) use ($debugbar) {
216
211
217
212
if ($ this ->shouldCollect ('route ' )) {
218
213
try {
219
- if ($ this ->checkVersion ('4.1 ' )) {
214
+ if ($ this ->checkVersion ('4.1 ' , ' >= ' )) {
220
215
$ this ->addCollector ($ this ->app ->make ('Barryvdh\Debugbar\DataCollector\IlluminateRouteCollector ' ));
221
216
} else {
222
217
$ this ->addCollector ($ this ->app ->make ('Barryvdh\Debugbar\DataCollector\SymfonyRouteCollector ' ));
@@ -761,6 +756,6 @@ public function addMessage($message, $label = 'info')
761
756
*/
762
757
protected function checkVersion ($ version , $ operator = ">= " )
763
758
{
764
- return version_compare ($ this ->version , $ version , $ operator );
759
+ return version_compare ($ this ->app -> version () , $ version , $ operator );
765
760
}
766
761
}
0 commit comments