laravel-ide-helper: ide-helper doesn't generate added Facades (Lumen)

Registered Facades and Service Providers as Lumen says

app/bootstrap.php

$app->register(App\Services\HappyService\HappyServiceProvider::class); class_alias(App\Services\HappyService\Happy::class, 'Happy');

_ide_helper.php doest not load Happy Facade. It also happens with some services and facades (like Validate among others). In code, the app works flawlessly.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

You shouldn’t just class_alias, but add the Facade to the app.php config.

app/Providers/AppServiceProvider.php:boot()

    if ($this->app->environment() !== 'production') {
            app('config')->set('app.aliases', [
                'Validator' => 'Illuminate\Support\Facades\Validator',
                'Eloquent'=>'Illuminate\Database\Eloquent\Model'
                //add other map you want
            $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
    }

this is just enough for Lumen 5.5 ,with out any other side effect

https://github.com/barryvdh/laravel-ide-helper/issues/611#issuecomment-361163745

@westphalen @maksimru @servocoder