pedi2/app/Producto.php

23 lines
441 B
PHP
Raw Normal View History

2021-12-30 13:12:14 -03:00
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Producto extends Model
{
public $timestamps = false;
protected $fillable = [ "nombre", "precio", "presentacion", "stock", "categoria" ];
public function subpedidos()
{
return $this->belongsToMany('App\Subpedido','productos_subpedidos')->withPivot(["cantidad"]);
}
public function proveedor()
{
return $this->belongsTo('App\Proveedor');
}
}