iberflow / laravel-model-generator

Laravel 5 model generator for an existing schema
264 stars 75 forks source link

Feature request: SetGetGenerator to generate also relations #47

Open tpfuhl opened 7 years ago

tpfuhl commented 7 years ago

Hello, is it possible that the SetGetGenerator also generates relations, making use of the foreign keys defined in the schema ? Example:

/**
     * retrieve related table relTable
     * @return mixed
     */
    public function relTable() {
        return $this->hasOne('App\Models\RelTable', 'id', 'relTableID'); // one to one relation
    }

That would be a major improvement. Thanx for your valuable work, Thomas

Oh --- I just saw that you already thought about that in #9 (closed), and marked it, sadly, as wontfix. What a pity.