Haehnchen / idea-php-laravel-plugin

Laravel Framework Plugin for PhpStorm / IntelliJ IDEA
MIT License
572 stars 108 forks source link

Suggestion: Generate PHPDoc block properties for model classes based on respective database table columns #272

Open eliseuborges opened 3 years ago

eliseuborges commented 3 years ago

I was wondering if would be possible generate PHPDoc block properties for model classes based on respective database table columns. Example:

/**
 * Class User
 *
 * @property integer $id
 * @property string $nome
 * @property string $email
 * @property Carbon $email_verified_at
 * @property string $password
 * @property string $remember_token
 * @property Carbon $created_at
 * @property Carbon $updated_at
 * @property Carbon $deleted_at
 * @package App\Models
 */
class User extends
...
mfn commented 3 years ago

Basically what https://github.com/barryvdh/laravel-ide-helper does.

This requires knowing and being able to access the database to introspect and read the meta data out of it.

On top of it for certain cases of special database types you need mappings.

Further this would require the plugin to actually know where the DB is. What is you're using docker/vagrant and you can't "just connect", because you need a remote connection setup / tunnel /etc.?

This is all covered by ide-helper btw.