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

jimmck's avatar

When added vendor dir, all the sub dirs got added. Resources are purple and Sources are Blue. What version of storm are you using? Your on Linux if I remember?

vincej's avatar
Level 15

well I made laravel "public dir" the resource root and I have now more errors than a Christmas tree. red ones as well as yellow ones. yikes.

vincej's avatar
Level 15

storm 8.0.3 - the most up to date. Yes, Linux.

vincej's avatar
Level 15

yup - vendor as well.

Now I'm also getting "undefined class" and "undefined namespace" in addition to "undefined method".

jimmck's avatar

Ok lets do this:

  1. Click on the x button for all the blues and remove them. Dont worry it will not deleter them
jimmck's avatar

Then add your app directory as your first source... Then add Vendor as your next

vincej's avatar
Level 15

ok got app vendor

still getting undefined class.

jimmck's avatar

so we have 2 source dirs app and vendor?

And a purple resource dir which is public?

if yes. Click Ok to save and restart storm

jimmck's avatar

yup its purple. The keys are the source dirs. Storm is brain dead without knowing about them.

jimmck's avatar

Dont worry if something is missing. Key is laravel stuff is green to slightly yellow...

vincej's avatar
Level 15

it's a bit better - all the red warnings are gone but still have a lot of method not found, undefined class

my directories are app - source / public: resource root / vendor - source

btw - my wife is calling me for dinner so I have about 3 mins. :o)

vincej's avatar
Level 15

what does this mean:

Key is laravel stuff is green to slightly yellow...my L5 apps are blue folders. The stuff which has not been selected is slightly yellow

jimmck's avatar

Ok now the code would help. I also signed up form this imgur stuff and will post a shot of my settings

jimmck's avatar

We want to make sure Laravel packages are being recognized.

jimmck's avatar

Ok. Your looking Ok. Its your project specific stuff that has go be cleaned up.

vincej's avatar
Level 15

@jimmck

Jim - you are a gentleman, Many thanks for helping out. Ok, looking at your screen shot, I can see that I was adding the directories in the totally wrong manner. I have fixed that now, as you can see in the screen shot. 90% of the warnings are now gone. However ... I am still getting 3 warnings:

$data = input::all(); "method 'all ' not found in class \illuminate\support\facades\Input"

Flash::error "method 'error' not found in class \Laracasts\Flash\Flash

return DB::table('contractors') ->where('status', 'active') "undefined function 'status'"

I have _ide_helper.php in the root directory.

Francismori7's avatar

You can fix those by importing the facade itself.

Example:

use Input;

Or simply using \Input::all();

IDE-helper will then provide the rest for PHPStorm. Laravel uses reflection and some hard stuff for IDEs to predict. You might get a multiple definitions found warning for them.

vincej's avatar
Level 15

@Francismori7

Many thanks for that. use Input fixed it. What I do not understand is that I had already included

use Illuminate\Support\Facades\Input;

why does Input work and use Illuminate\Support\Facades\Input; not work ?

Similarly, I am still getting an error with status "undefined function" yet, I have use DB

 return DB::table('contractors')
        ->where('status', 'active')
vincej's avatar
Level 15

@jimmck

Many thanks for working this out. Award point to you. In the end it was the answer which solved my problem, and so for the benefit of any future users who are searching for the most appropriate answer I have to nominate yours.

Many Many Thanks to all the rest to jumped in to help - your assistance is not taken for granted !! cheers !

jimmck's avatar

@vincej Thanks My Pleasure! Enjoy Storm, it can drive you crazy, but I find it most useful.

Jim

jimmck's avatar

@vincej Regarding multiple warnings. When you typing in a class name reference. Storm will begin popping up its best guess. Look at the referring Namespace to help you pick the correct one. If you see the same class you already added via a use statement listed twice, one with the class name only and one with Namespace directly before or after pick the one w/o namespace. And some advice on Storm Early Access releases, I wait till about a month before the real release. Storm 9 is due end of June and I am using EAP only now. Also, your ide settings become precious, so make sure to export them by: File->Export Settings... it will save it to xml file you can import. Storm is pretty good about not trashing them, but sometimes either through quick fingers or an early EAP they get wacked.

vincej's avatar
Level 15

@jimmck Great advice, I'll do an export straight away.

I followed your advice and eliminated all those use statements with a name space and it cleared up a few more. I'm now down to 3-4 a file, where I used to be getting 30 !

I'm still getting notices around Query Builder despite using use DB

Meathod "whereId not found"

 Contractor::whereId($id)->update($request->except(['_method','_token']));
       return redirect('labour/contractors/show');

It's a bit like "needle in a haystack stuff" :o)

Cheers ! Many Thanks

ps - I'm in Alberta, where are you ?

jimmck's avatar

@vincej Hi, I am in Holmdel, New Jersey, US. the compiled.php file can cause duplicate definitions warnings. It is in Vendor directory, so cannot do anything. I believe it is moving back to Storage directory in 5.1. You can then exclude that directory in the Projects directory. I don't use Eloquent, but I created a model class and I don't see whereId in the popup of available methods? Storm does not know how to find dynamic invocations or overrides handled by magic methods. You may find an annotation to help it, along the lines of /* @var */...

Please or to participate in this conversation.