Incluidos los nuevos modelos en Lumen

This commit is contained in:
2021-05-01 00:50:57 -04:00
parent cc71f05a57
commit 0c282c10ef
4 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
<?php
namespace App\Models;
use App\Traits\UuidPrimaryKey;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Caja extends Model {
use UuidPrimaryKey, SoftDeletes;
protected $table = 'cajas';
public function restaurante() {
return $this->belongsTo(Restaurante::class);
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace App\Models;
use App\Traits\UuidPrimaryKey;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Efectivo extends Model {
use UuidPrimaryKey, SoftDeletes;
protected $table = 'efectivos';
public function caja() {
return $this->belongsTo(Caja::class);
}
}

View File

@@ -0,0 +1,13 @@
<?php
namespace App\Models;
use App\Traits\UuidPrimaryKey;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class MedioPago extends Model {
use UuidPrimaryKey, SoftDeletes;
protected $table = 'medios_pago';
}

View File

@@ -23,6 +23,14 @@ class Venta extends Model {
return $this->belongsTo(Restaurante::class); return $this->belongsTo(Restaurante::class);
} }
public function caja() {
return $this->belongsTo(Caja::class);
}
public function medioPago() {
return $this->belongsTo(MedioPago::class);
}
public function productos() { public function productos() {
return $this->hasMany(VentaProducto::class); return $this->hasMany(VentaProducto::class);
} }