-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Readme [Lumen]: Simpler solution for supporting additional Facades and a note on getting Eloquent mixin to work. #438
Conversation
- Currently docs suggest to create `config/app.php` just for aliases (but to renaming it something else) and having to rename it back every time you need to re-generate your ide-helper files. Instead suggest copying the config/app.php from vendor folder (just like you would do to override any other values in this config) and adding your aliases to it and leaving the file there. - Also adds note on adding `Eloquent` to `aliases` array so that `@mixin \Eloquent` works for autocompletion.
We might even be able to provide a |
Currently, Lumen's I updated my pull for that particular reason also. |
@MitchellMcKenna do you feel this PR is still relevant? |
@mfn Yes, just tested out again with latest lumen version. I was only able to get
Not sure why that step is necessary as well. Like @DarkGhostHunter said, Lumen doesn't use illuminate AliasLoader so adding aliases in laravel-ide-helper/src/Generator.php Line 273 in 6c8e847
config/app.php for ide-helper to set them up for autocompletion.
I will update the pull request with $app->withFacades() change and make the readme clearer as well. |
After struggling for hours looking through #438 (comment) and #611 (comment) and even #723, and so many other issues, the cleanest way to tell class_alias(Illuminate\Database\Eloquent\Model::class, 'Eloquent');
$app->config->set('app.aliases', ['Eloquent' => Illuminate\Database\Eloquent\Model::class]);
$app->register(Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); That was rough, not to mention how we'd set up our project is somewhat peculiar. Not really recommended to everyone. |
I'm proposing to drop official suport for Lumen for the following reasons: - Lumen itself is dead, per [1] > **Note:** In the years since releasing Lumen, PHP has made a variety of wonderful performance improvements. For this reason, along with the availability of [Laravel Octane](https://laravel.com/docs/octane), we no longer recommend that you begin new projects with Lumen. Instead, we recommend always beginning new projects with [Laravel](https://laravel.com). Laravel Octact is just Laravel and no one using ide-helper with it needs anything special. - For now, the change is mostly on the logistics side (readme, run tests, issues). In the past we had some special code but over time this was already removed. For now people still can use it and nothing will break out of the blue, but eventually it might There are a only a few Lumen related issues open currently which would be closed by this (barryvdh#1105, barryvdh#1069, barryvdh#438). [1] laravel/lumen@69b2657
I'm proposing to drop official suport for Lumen for the following reasons: - Lumen itself is dead, per [1] > **Note:** In the years since releasing Lumen, PHP has made a variety of wonderful performance improvements. For this reason, along with the availability of [Laravel Octane](https://laravel.com/docs/octane), we no longer recommend that you begin new projects with Lumen. Instead, we recommend always beginning new projects with [Laravel](https://laravel.com). Laravel Octact is just Laravel and no one using ide-helper with it needs anything special. - For now, the change is mostly on the logistics side (readme, run tests, issues). In the past we had some special code but over time this was already removed. For now people still can use it and nothing will break out of the blue, but eventually it might There are a only a few Lumen related issues open currently which would be closed by this (barryvdh#1105, barryvdh#1069, barryvdh#438). [1] laravel/lumen@69b2657
I'm proposing to drop official suport for Lumen for the following reasons: - Lumen itself is dead, per [1] > **Note:** In the years since releasing Lumen, PHP has made a variety of wonderful performance improvements. For this reason, along with the availability of [Laravel Octane](https://laravel.com/docs/octane), we no longer recommend that you begin new projects with Lumen. Instead, we recommend always beginning new projects with [Laravel](https://laravel.com). Laravel Octact is just Laravel and no one using ide-helper with it needs anything special. - For now, the change is mostly on the logistics side (readme, run tests, issues). In the past we had some special code but over time this was already removed. For now people still can use it and nothing will break out of the blue, but eventually it might There are a only a few Lumen related issues open currently which would be closed by this (#1105, #1069, #438). [1] laravel/lumen@69b2657 Co-authored-by: Barry vd. Heuvel <[email protected]>
Hey 👋🏼 whilst integration in Lumen might still work, due to decline in usage of Lumen and better alternatives like Laravel Octane, Lumen is not officially supported anymore (the state of affairs where never really great, to begin with) |
I'm proposing to drop official suport for Lumen for the following reasons: - Lumen itself is dead, per [1] > **Note:** In the years since releasing Lumen, PHP has made a variety of wonderful performance improvements. For this reason, along with the availability of [Laravel Octane](https://laravel.com/docs/octane), we no longer recommend that you begin new projects with Lumen. Instead, we recommend always beginning new projects with [Laravel](https://laravel.com). Laravel Octact is just Laravel and no one using ide-helper with it needs anything special. - For now, the change is mostly on the logistics side (readme, run tests, issues). In the past we had some special code but over time this was already removed. For now people still can use it and nothing will break out of the blue, but eventually it might There are a only a few Lumen related issues open currently which would be closed by this (barryvdh#1105, barryvdh#1069, barryvdh#438). [1] laravel/lumen@69b2657 Co-authored-by: Barry vd. Heuvel <[email protected]>
config/app.php
just for aliases (but to rename it something else) and having to rename it back every time you need to re-generate your ide-helper files. Instead this suggests copying the config/app.php from vendor folder (just like you would do to override any other values in this config) and adding your aliases to it and leaving the file there.Eloquent
toaliases
array so that@mixin \Eloquent
works for autocompletion.