cotizaweb/app/Models/Cotizacion.php
jesusfb 161fcee049
Some checks are pending
Deploy to EC2 cotiza / deploy (push) Waiting to run
first commit
2026-04-24 12:53:27 -07:00

40 lines
725 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Cotizacion extends Model
{
use HasFactory;
protected $table = 'cotizaciones';
protected $fillable = [
'company_id',
'cliente_id',
'token',
'estado',
'subtotal',
'iva',
'total',
];
public function company()
{
return $this->belongsTo(Company::class);
}
public function cliente()
{
return $this->belongsTo(Client::class);
}
// 🔥 ESTA ES LA RELACIÓN CORRECTA
public function items()
{
return $this->hasMany(CotizacionItem::class, 'cotizacion_id');
}
}