39 lines
831 B
PHP
39 lines
831 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Traits\UuidPrimaryKey;
|
|
use App\Exceptions\ModelNotFoundException;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Venta extends Model {
|
|
use UuidPrimaryKey, SoftDeletes;
|
|
|
|
protected $table = 'ventas';
|
|
|
|
public function mesero() {
|
|
return $this->belongsTo(Mesero::class);
|
|
}
|
|
|
|
public function canal() {
|
|
return $this->belongsTo(CanalVenta::class);
|
|
}
|
|
|
|
public function restaurante() {
|
|
return $this->belongsTo(Restaurante::class);
|
|
}
|
|
|
|
public function caja() {
|
|
return $this->belongsTo(Caja::class);
|
|
}
|
|
|
|
public function medioPago() {
|
|
return $this->belongsTo(MedioPago::class);
|
|
}
|
|
|
|
public function productos() {
|
|
return $this->hasMany(VentaProducto::class);
|
|
}
|
|
}
|