PhpStorm autocomplete Laravel 5 models

I installed Barryvdh class and Laravel plugin for PhpStorm, but I can't get the models to autocomplete and PhpStorm is throwing warnings to me. I looked at this answer and many others to no avail. If I change my model from

class Promotion extends Model

      

to

class Promotion extends \Eloquent

      

Then it works. But I feel like having to change every model is silly. I will have to keep this in mind when creating new models.

Solution 2 looks like the best option. I changed config/ide_helper.php

from

'Eloguent' => array('Illuminate\Database\Eloquent\Builder', 'Illuminate\Database\Query\Builder'),

      

For

'Model' => array('Illuminate\Database\Eloquent\Builder', 'Illuminate\Database\Query\Builder'),

      

I added this line to my aliases in config/app.php

, but I don't think this is correct and I don't know what is actually the correct class, because it doesn't work, many other options I've tried

'Model' => Illuminate\Database\Eloquent\Builder::class

      

I cleared the cache and restarted PhpStorm many times and now it works on three different computers with the same result. It seems so stupid and I feel so stupid because he is probably so simple, but he cannot see him.

I am using PhpStorm 2017.1, Laravel 5.3

+3


source to share





All Articles