se terminaron los modelos, faltan controlarlos con la IA
This commit is contained in:
@@ -18,11 +18,12 @@ class Persona extends Model
|
||||
'cuil',
|
||||
'fechanac',
|
||||
'foto_id',
|
||||
'telefono_id'
|
||||
];
|
||||
|
||||
public function Foto()
|
||||
{
|
||||
return $this->belongsTo(Foto::class, 'foto_id');
|
||||
return $this->belongsTo(Foto::class, 'foto_id', 'id');
|
||||
}
|
||||
|
||||
public function profesionales()
|
||||
@@ -32,11 +33,11 @@ class Persona extends Model
|
||||
|
||||
public function cliente()
|
||||
{
|
||||
return $this->hasOne(Cliente::class, 'persona_id');
|
||||
return $this->hasOne(Cliente::class, 'persona_id', 'id');
|
||||
}
|
||||
|
||||
public function telefonos()
|
||||
{
|
||||
return $this->belongsToMany(Telefono::class, 'personas_telefonos', 'persona_id', 'telefono_id');
|
||||
return $this->belongsToMany(Telefono::class, 'persona_telefono', 'persona_id', 'telefono_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user