1

Can anyone help me with this error? Im new to laravel and i was making a productController file but im getting this error from Validator:

enter image description here

I have called use Validator; What else can i do

Lirik Rexhepi
  • 67
  • 1
  • 7
  • 1
    Do you have the corresponding `use Illuminate\Support\Facades\Validator;` on the top of your file? – apokryfos Dec 08 '22 at 17:03
  • Yeah i think it was just intelephense error – Lirik Rexhepi Dec 08 '22 at 17:07
  • 1
    I would recommend you 100% to switch to PHPStorm, it is paid, but if you or your company can afford the license, you will not have these issues and you will get a big help. You can also try PHPStorm EAP (Beta release) that one is free but could have errors – matiaslauriti Dec 08 '22 at 19:24

1 Answers1

2

Install the following package:

composer require --dev barryvdh/laravel-ide-helper

After, run:

php artisan ide-helper:models
php artisan ide-helper:generate
php artisan ide-helper:meta

And finally, install this extension on your vs code: https://marketplace.visualstudio.com/items?itemName=georgykurian.laravel-ide-helper

Also, another good to have (optional): https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client

It should solve your problem.