se terminaron los modelos, faltan controlarlos con la IA
This commit is contained in:
+12
-5
@@ -9,6 +9,8 @@ class Servicio extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'servicios';
|
||||
|
||||
protected $fillable = [
|
||||
'titulo',
|
||||
'estado',
|
||||
@@ -19,24 +21,29 @@ class Servicio extends Model
|
||||
|
||||
//pertenece a
|
||||
|
||||
public function contenido()
|
||||
public function contenidoWeb()
|
||||
{
|
||||
return $this->belongsTo(Contenido::class, 'contenido_id');
|
||||
return $this->belongsTo(ContenidoWeb::class, 'contenidoweb_id', 'id');
|
||||
}
|
||||
public function profesion()
|
||||
{
|
||||
return $this->belongsTo(Profesion::class, 'profesion_id');
|
||||
return $this->belongsTo(Profesion::class, 'profesion_id', 'id');
|
||||
}
|
||||
public function foto()
|
||||
{
|
||||
return $this->belongsTo(Foto::class, 'foto_id');
|
||||
return $this->belongsTo(Foto::class, 'foto_id', 'id');
|
||||
}
|
||||
|
||||
// Tiene un
|
||||
|
||||
public function formulario()
|
||||
{
|
||||
return $this->hasOne(Formulario::class, 'servicio_id');
|
||||
return $this->hasOne(Formulario::class, 'servicio_id', 'id');
|
||||
}
|
||||
|
||||
public function turno()
|
||||
{
|
||||
return $this->hasOne(Turno::class, 'servicio_id', 'id');
|
||||
}
|
||||
|
||||
//Tablas intermedias
|
||||
|
||||
Reference in New Issue
Block a user