58 lines
1.1 KiB
PHP
Executable File
58 lines
1.1 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Tarifas extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'pantallas',
|
|
'dias',
|
|
'valor',
|
|
'utilidad',
|
|
'estado',
|
|
'servicio_id',
|
|
'rol_id',
|
|
'subvendedor_id',
|
|
];
|
|
|
|
public function servicio()
|
|
{
|
|
return $this->belongsTo(Servicio::class);
|
|
}
|
|
|
|
public function preferenciales()
|
|
{
|
|
return $this->hasMany(Preferencial::class, 'tarifa_id');
|
|
}
|
|
|
|
public function cuentas()
|
|
{
|
|
return $this->hasMany(Cuentas::class, 'tarifa_id');
|
|
}
|
|
|
|
public function historiales()
|
|
{
|
|
return $this->hasMany(Historiale::class, 'tarifa_id');
|
|
}
|
|
|
|
public function promociones()
|
|
{
|
|
return $this->belongsToMany(Promociones::class, 'promocion_tarifas', 'tarifa_id', 'promocion_id');
|
|
}
|
|
|
|
public function rol()
|
|
{
|
|
return $this->belongsTo(Role::class);
|
|
}
|
|
|
|
public function usuario_tarifas()
|
|
{
|
|
return $this->hasMany(Usuario_tarifa::class, 'tarifa_id');
|
|
}
|
|
}
|