Initial commit
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?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',
|
||||
'estado',
|
||||
'servicio_id',
|
||||
'rol_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');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user