Merge branch 'bryam' of https://github.com/BryamE/ProyectoLauck into giane

This commit is contained in:
Bryam105
2025-12-09 11:07:22 -03:30
27 changed files with 935 additions and 192 deletions
+16 -9
View File
@@ -8,16 +8,24 @@ use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
use HasFactory;
protected $fillable = [
'codigo',
'nombre',
'costo',
'precio',
'stock',
'min_stock',
'categoria',
'descripcion'
'name',
'sku',
'description',
'price',
'cost',
'stock_quantity',
'min_stock_alert',
'type',
'serial_number'
];
public function hasLowStock(): bool
{
return $this->stock_quantity <= $this->min_stock_alert;
}
public function supplier()
{
return $this->belongsTo(Suppliers::class);
@@ -36,7 +44,6 @@ class Product extends Model
{
return $this->belongsToMany(Sale::class, 'sale_details');
}
}
/**$user->sales: Te da la lista de todas las compras de ese usuario.