I'm not able to reproduce the issue. I created a fresh laravel project and it indexed around 4400 files. When editing the user model go to def, symbol search, completions all worked. Note that the extension will only index files in the open folder/workspace (and descendant folders). When a workspace has been previously indexed then only those files that have been modified outside of a vscode session will be reindexed. This is why it will quite often show 0 files indexed when reopening.

I had a similar issue, turned out I had
"files.associations": {
"*.inc": "php"
}
And it was indexing only the *.inc files.
@bmewburn - is it correct that files.associations is meant to replace the file associations and so I would need to list *.php here too?
Anyway, can confirm either removing the files.associations or adding "*.php": "php" seems to fix this issue for me.
I wonder @calebporzio, does this solve your issue too?
@zorfling that's correct. It will use the php file association values when finding files and default to *.php if there are none.
Boom! fixed! thanks @zorfling. I had my file associations set for .php_cs files:
"files.associations": {
".php_cs": "php",
".php_cs.dist": "php"
},
Everything is indexing fine now, thanks!
Thanks for posting that fix, I was getting either 0 files or 19 files indexed on a Laravel app, until I updated my settings to this:
"files.associations": {
".php_cs": "php",
"*.php": "php"
},
Much better!

Next release I'll include *.php regardless of files.associations setting as this issue seems pretty common.
Thanks @bmewburn
On further reading it seems like that might be how files.associations is supposed to work (an addition, not a replacement).
VS Code docs don't seem to suggest you need to add *.php in there as well.
Anyway, thanks very much! Loving Intelephense now it's indexing 馃憤
I have added the following
"files.associations": {
".php_cs": "php",
"*.php": "php"
},
And I'm still seeing this when I try to index my laravel project.

Anyone able to give me some more info?
EDIT: Turns out I needed to run the PHP Intelephense "Clear Cache and Reload" command.

Then I was in business.
[Info - 13:29:25] Initialising
[Info - 13:29:30] Initialised in 4892 ms
[Info - 13:29:30] Intelephense 0.8.6
[Info - 13:29:30] Indexing started.
[Info - 13:31:59] Indexing ended | 9630 files | 148.796 s
I have added the following
"files.associations": { ".php_cs": "php", "*.php": "php" },And I'm still seeing this when I try to index my laravel project.
Anyone able to give me some more info?
EDIT: Turns out I needed to run the PHP Intelephense "Clear Cache and Reload" command.
Then I was in business.
[Info - 13:29:25] Initialising [Info - 13:29:30] Initialised in 4892 ms [Info - 13:29:30] Intelephense 0.8.6 [Info - 13:29:30] Indexing started. [Info - 13:31:59] Indexing ended | 9630 files | 148.796 s
this worked for me, Clear Cache and Reload, thanks!
The solution provided in the above comments was not working for me. I have to add the following settings in settings.json
"intelephense.files.associations": ["*.php", "*.phtml", "*.inc", "*.module", "*.install", "*.theme", ".engine", ".profile", ".info", ".test"]
All the day trying to figure out why this morning Intelephense was not indexing all my files. Last week it was working fine.
@msankhala solution worked for my Drupal project.
As of now only the solution provided by @msankhala works!
However, some of the extensions are preceded with *. and other with just .
Is there are reason for that? (I did normalize to *. on my end and things are working fine).
@bmewburn Clear Cache and Reload is not available anymore, if there away to force reindex the workspace ?
@ctf0 it's now Index workspace
@bmewburn using the command doesnt force the reindex "the ext output remains the same", i think this is related to the smart indexing that u mentioned earlier.
but what i expected is that the ext will remove the cache and start reindexing
@ctf0 what is the issue you are trying to solve? The command above will start the workspace indexing and overwrite the cache.
sometimes i can ctrl+click or get autocomplete for traits & the output i get always remains
[Info - 1:26:36 AM] Initialising intelephense 1.0.14
[Info - 1:26:36 AM] Reading state from c:\Users\abc\AppData\Roaming\Code\User\workspaceStorage\89758ba8bd8845fd29027fd75b534fb3\bmewburn.vscode-intelephense-client\72cba44c.
[Info - 1:26:36 AM] Initialised in 161 ms
[Info - 1:26:42 AM] Indexing started.
[Info - 1:26:42 AM] Indexing ended. 3 files indexed in 0s.
so i thought using the command will clear all and give a different output
The file count is just the number of files that needed to be indexed outside of what has already been indexed previously, not necessarily all files in the workspace. If it's not picking up all your files then make sure you have all the php file extensions that you use listed in the intelephense.files.associations setting. If you really want to make sure the cache is removed then you can manually delete the dir listed in the output.
intelephense.files.associations settings is the default"search.useIgnoreFiles": false, to include the vendor folder into the global gotoworkspaceStorage and the output is now[Info - 1:42:53 AM] Initialising intelephense 1.0.14
[Info - 1:42:53 AM] Initialised in 11 ms
[Info - 1:42:53 AM] Indexing started.
[Info - 1:43:08 AM] Indexing ended. 194 files indexed in 15s.
[Info - 1:43:08 AM] Writing state to c:\Users\abc\AppData\Roaming\Code\User\workspaceStorage\89758ba8bd8845fd29027fd75b534fb3\bmewburn.vscode-intelephense-client\72cba44c.
[Info - 1:43:08 AM] Wrote state in 0.2s.
which is definitely incorrect.
if there is something i can offer to help debug, plz do tell
I think it's best to open a new issue. Please add a code example and describe the actual problem.
Most helpful comment
The solution provided in the above comments was not working for me. I have to add the following settings in settings.json