I have been working on learning Laravel. I am using Homestead with VirtualBox - and my IDE is vscode. I have been getting the "problem lines" under inane things in my IDE... see below:
I can't figure out why something like "view" or "isNot" has those error lines. Everything works fine I am just wondering why the IDE is throwing intelephenser(1013) problems at me.
Here are the errors it is throwing:
Any ideas on getting rid of this would be appreciated! :D
Laravel has global helper function and class aliases declared
You can use barryvdh/laravel-ide-helper to help your IDE recognize the helpers and aliases.
Follow this guide if you struggle installing it.
basicly
$ composer require --dev barryvdh/laravel-ide-helper
$ php artisan ide-helper:generate
$ php artisan ide-helper:meta
$ php artisan ide-helper:models --nowrite
Add annotation to your variable like so:
/** @var \App\Models\User $user **/
$user = Auth::user();
It'd tell PHP intelephense that $user variable is not Illuminate\Foundation\Auth\User
but \App\Models\User
.
Ref: https://stackoverflow.com/a/69580333/11297747
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With