rjsargeant's avatar

VSCode Laravel Intellisense and Extra Intellisense Plugins Not Working

Has anyone experienced problems with the Laravel Intellisense and/or Laravel Extra Intellisence VSCode plugins. I have tested every possible combination of plugins to find any incompatibility but both continue to fail to provide any intellisense. I'm running Laravel 9 and PHP 8.1. Any thoughts would be appreciated.

0 likes
2 replies
newbie360's avatar

@rjsargeant backup your project first, then try to install https://github.com/barryvdh/laravel-ide-helper

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

php artisan ide-helper:generate

// -N means don't overwrite your exists model
// without -N , the command will ask you overwrite the exists model, just answer 'no'
php artisan ide-helper:models -N

edit composer.json, ONLY change the code inside "post-update-cmd" , the first line is end of ,

    "scripts": {
        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force",
            "@php artisan ide-helper:generate",
            "@php artisan ide-helper:models -N"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },

edit your-project\.gitignore , at the end add

_ide_helper.php
_ide_helper_models.php
rjsargeant's avatar

Problem disappeared after I uninstalled and reinstalled vscode and all plug-ins. So presumably some conflict between vscode plug-ins

Please or to participate in this conversation.