sunshinev / laravel-gii

Generate CRUD based on Mysql table structure Laravel Extension package
https://sunshinev.github.io/laravel-gii-home/
GNU General Public License v3.0
112 stars 24 forks source link

It would be nice if the @property's had the type of data described #6

Closed HenkPoley closed 4 years ago

HenkPoley commented 4 years ago

I understand that removing the docblock and then running barryvdh/laravel-ide-helper's php artisan ide-helper:models -W will write in that annotation data. But it's sort of the point why you want to use a generator like this.

(to then maybe chain it with mpociot/laravel-test-factory-helper)

sunshinev commented 4 years ago

It's a good idea, I tried to optimize it recently

sunshinev commented 4 years ago

In the latest tag V1.0.3, I have optimze the ModelBusiness by Doctrine Types. Now the properties looks like

/**
* @property bigint $id
* @property string $name
* @property string $email
* @property string $email_verified_at
* @property string $password
* @property string $remember_token
* @property datetime $created_at
* @property datetime $updated_at
*/

As we all know, the datetime,bigint type is not php types. But it doesn't affect understanding

sunshinev commented 4 years ago

Doctrine Types: https://www.doctrine-project.org/projects/doctrine-dbal/en/2.10/reference/types.html#types

HenkPoley commented 4 years ago

Nice, I first thought that vimeo/psalm (one of my main use cases) doesn't understand doctrine @property's, but it does 👍