Skip to content
This repository has been archived by the owner on Mar 12, 2022. It is now read-only.

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

Open
eliseuborges opened this issue Apr 22, 2021 · 1 comment

Comments

@eliseuborges
Copy link

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
Copy link

mfn commented Apr 22, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants