PHPStorm auto-complete not working with Laravel 5 [duplicate] PHPStorm auto-complete not working with Laravel 5 [duplicate] laravel laravel

PHPStorm auto-complete not working with Laravel 5 [duplicate]


Two possible fixes for that:

  1. Make your models extend the \Eloquent facade instead ofIlluminate\Database\Eloquent\Model.
  2. 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.

(Source: https://laracasts.com/discuss/channels/general-discussion/phpstorm-thinks-modelwhere-doesnt-exist-on-model-l5/replies/37661)


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 in config/app.phpBarryvdh\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).

Source: https://github.com/barryvdh/laravel-ide-helper


In addition to the IDE Helper, you must enable the Laravel Plugin per-project in PHPStorm.

  1. Open preferences.
  2. Navigate to Laravel Plugin
  3. Check Enable plugin for this project