PHPStorm auto-complete not working with Laravel 5 [duplicate]
Two possible fixes for that:
- Make your models extend the \Eloquent facade instead ofIlluminate\Database\Eloquent\Model.
- If you prefer to keep using the"Model" facade, you can make your own alias in config/app.php,then change "eloquent" to "model" in the config/ide-helper.php underextra. This will let ide-helper include all the methods fromIlluminate\Database\Eloquent\Builder andIlluminate\Database\Query\Builder which is where the missing methodsactually live.
This article got me going with PHPStorm 2016.1.2, but it is one year older so I suppose it would work with older version.
https://blog.jetbrains.com/phpstorm/2015/01/laravel-development-using-phpstorm/
The only details that are probably missing, I found them on the plugin GitHub link:
After updating composer, add the service provider to the
providers
array inconfig/app.php
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
php artisan ide-helper:generate
Note: bootstrap/compiled.php has to be cleared first, so run php artisan clear-compiled before generating (and php artisan optimize after).