From abe2df58531543e1fde93a9bd950888881fbcb59 Mon Sep 17 00:00:00 2001 From: Karim Geiger Date: Mon, 5 Sep 2016 23:24:04 +0200 Subject: [PATCH] Fix "Using $this when not in object context" bug This commit fixes the "Using $this when not in object context" bug for the Lumen configuration. Since the `bootstrap/app.php`-file is not in object context, and the `app` instance accessible using the `$app` variable directly, using `$this->app` will result in a fatal error. --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index f9f5f6e..55c9403 100644 --- a/readme.md +++ b/readme.md @@ -200,8 +200,8 @@ You can install Laravel IDE Helper in `app/Providers/AppServiceProvider.php`, an If you are not using that line, that is usually handy to manage gracefully multiple Laravel/Lumen installations, you will have to add this line of code under the `Register Service Providers` section of your `bootstrap/app.php`. ```php -if ($this->app->environment() !== 'production') { - $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); +if ($app->environment() !== 'production') { + $app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); } ```