lundi 3 avril 2017

Php Storm Auto-complete Laravel 5 Models

I have installed Barryvdh class and the laravel plugin for phpstorm but I can't get the Models to autocomplete and phpstorm throws warnings at me. I have 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 the fact having to change every single model is silly.Plus when making new models I will have to remember to change this.

Solution 2 looks like the better option. I have changed the config/ide_helper.php from

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

To

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

I have then added this line to my aliases in config/app.php but I don't think this is right and don't know what is actually the right class to choose as this doesn't doesn't work, nor does the many other options I tried

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

I have cleared the cache and restarted phpstorm many times now and have it running on 3 different computers with the exact same result. This seems so stupid and I feel so stupid, because it is probably so simple but can't see it.

I'm using phpstorm 2017.1, Laravel 5.3



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire