I am going through the Laravel 5 Fundamentals Laracasts video set but am having some difficulties with Facades in my IDE (Phpstorm 8). I have a model which uses the Eloquent facade use Illuminate\Database\Eloquent\Model;
I have required the laravel-ide-helper composer require barryvdh/laravel-ide-helper, added the service provider to the providers array 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider',, regenerated the docs and restarted my IDE, but with no success.
I have a Model decleration in my Controller $article = Article::findOrFail($id); but the findOrFail method is highlighted and flagged as Method 'findOrFail' not found in class App\Article.
I am new to Laravel and the concept of Facades but am lost and have been unable to find an existing answer for my problem.
You're saying that you are using facades but at the same use the actual model class here use Illuminate\Database\Eloquent\Model;. So which one is it?
To be fair, there is really no point in using facades in Laravel, especially since version 5 came out. Almost everything can be accomplished with proper dependency injection and / or new helper methods. Makes the end result much clearer, IMO.
@mstnorris , is there any way to have the methods in the Eloquent/Builder.php class suggested in php storm? Because currently the findOrFail, update, latest and where (on queries) are being flagged as not found. As mentioned in the original question, I have ran all the install steps for the ide-helper. @JeffreyWay doesn't seem to have this issue in his IDE and he gets code suggestions on the functions listed above.
I've been dealing with the same issue, and it's driving me nuts. The IDE Helper doesn't fix it. I'd rather not memorize every magic method in the framework. Surely there is some way to get auto-complete to cooperate?