inventario/app/Models/Cotizacion.php
jesusfb a31af58b8f
All checks were successful
Deploy Laravel Directo / deploy (push) Successful in 5s
first commit
2026-04-24 17:34:00 -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');
}
}