idea-php-laravel-plugin icon indicating copy to clipboard operation
idea-php-laravel-plugin copied to clipboard

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

Open eliseuborges opened this issue 3 years ago • 1 comments

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
...

eliseuborges avatar Apr 22 '21 03:04 eliseuborges

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.

mfn avatar Apr 22 '21 05:04 mfn