- Replace with() with withJoin() for more efficient left joins - Fix foreign key and primary key assignments in relations - Update index page queries to use relation index method-Modify relation method generation in model to use belongsTo instead of hasOne- Adjust table column definitions for relation fields
6 lines
160 B
Plaintext
6 lines
160 B
Plaintext
|
|
public function {{relationMethod}}()
|
|
{
|
|
return $this->belongsTo({{relationModel}}, '{{foreignKey}}', '{{primaryKey}}'){{relationFields}};
|
|
}
|