23 lines
441 B
PHP
23 lines
441 B
PHP
|
<?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');
|
||
|
}
|
||
|
|
||
|
}
|