Laravel fill attributes template for each models

As you know in Laravel we have important static eloquent methods for updating and creating models. For example

User::create([
//attributes
...
]);

And

$user = User::find(123);
$user->update([
//attributes
...
]);

And many more too.

Is there a way through plugins or settings, that I can automatically put all the updatable columns? I use this regularly and it might speed up my work and for other developers that I know use it as well. We already have ide-helper:models by barryvdh laravel helper giving us all the attributes for the models, and we already have a protected $fillable; for each model that phpStorm could use to know which attributes needs to be filled.

Appreciate your help.

0
1 comment

Did you try Laravel plugins? I can see Laravel Idea plugin having some related functionality: https://twitter.com/laravel_idea/status/1412024579615301635

Without a plugin this could be possibly achievable via PhpStorm metadata, but this isn't implemented yet: https://youtrack.jetbrains.com/issue/WI-46049

0

Please sign in to leave a comment.