phpstorm autocomplete customModelMethod() in controller class

Posted 3 years ago by t0ne

i've got autocomplete running barry ide helper etc. but there's one thing i can't figure:

//inside a controller method
$user = User::findOrFail(1);
 $test = $user->getMethodMadeByMeInTheUserClass();
//phpstorm: method 'getMethodMadeByMeInTheUserClass' not found in ......Eloquent/Collection\.....Eloquent/Model

findOrFail returns a Eloquent Model, but i want to get autocomplete on the User model also (which contains 'getMethodMadeByMeInTheUserClass' method)

I to fix this is phpstorm? thanks in advance!

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.