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 Historiale extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $fillable = [
|
||||
'fecha_inicio',
|
||||
'fecha_final',
|
||||
'valor',
|
||||
'tipo_pago',
|
||||
'estado',
|
||||
'vendedor_id',
|
||||
'tarifa_id',
|
||||
'promocion_id',
|
||||
'cliente_id',
|
||||
'nombre_cliente'
|
||||
];
|
||||
|
||||
public function vendedor(){
|
||||
return $this ->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function tarifa(){
|
||||
return $this ->belongsTo(Tarifas::class);
|
||||
}
|
||||
|
||||
public function promocion(){
|
||||
return $this ->belongsTo(Promociones::class);
|
||||
}
|
||||
|
||||
public function cliente(){
|
||||
return $this ->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function cuentas(){
|
||||
return $this ->belongsToMany(Cuentas::class,'historial_cuentas','historial_id','cuenta_id');
|
||||
}
|
||||
|
||||
public function cuentas_obsoletas(){
|
||||
return $this ->belongsToMany(Cuentas::class,'logs','historial_id','cuenta_id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user