Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dhiaben20's avatar

PHP Intelephense not detecting existing methods

Hello, I use VS Code with the PHP Intelephense extension, and I’m facing an issue with it.

Sometimes I call methods that I know do exist, but Intelephense warns me that the method does not exist.

Also, when I try to "Go to Definition" on some classes, it takes me to a generated file under vendor/_ide_helper/, which contains the same class but with incomplete definitions, and sometimes it takes me to this file: /vendor/inertiajs/inertia-laravel/_ide_helpers.php.

Example: I’m inside a FormRequest class and trying to call $this->method(). This method exists because FormRequest extends Illuminate\Foundation\Http\FormRequest, which extends Illuminate\Http\Request, which implements the method() method.

However, Intelephense still says the method does not exist, and "Go to Definition" takes me to an incomplete stub.

Has anyone faced this issue? Is there a way to fix it?

0 likes
4 replies
dhiaben20's avatar

@Tray2 i'm not a heavy backend developer, i work with frontend most of the time. but i remember i didn’t face these issues in the past. i think the solution is just to tell php intelephense to ignore those files that cause the issue.

dhiaben20's avatar

@martinbean thanks, i did this and it worked

"intelephense.files.exclude": [
	"**/vendor/_laravel_ide",
	"**/vendor/inertiajs/inertia-laravel/_ide_helpers.php"
],
1 like

Please or to participate in this conversation.