Comments on models #117
Replies: 1 comment 1 reply
-
Hi, the properties and methods in Models are generated by the laravel-ide-helper module: https://github.com/barryvdh/laravel-ide-helper. These comments are used exclusively for improved IDE autocompletion. I myself use PHPStorm from JetBrains where this works pretty good. Whenever the database structure is modified these comments can be re-generated with this artisan command:
Laravel Eloquent models use PHP magic getter/setter methods by default for all properties/attributes. That's why they aren't defined in code like you normally would expect. Hence the reason why the ide-helper package exists in order to improve the developer flow. |
Beta Was this translation helpful? Give feedback.
-
Hey!
I just have a little question, i saw in models you put all the properties and method in comments and not in code.
Is there a reason, i am just interesting to know :)
Beta Was this translation helpful? Give feedback.
All reactions