Incluidos los nuevos modelos en Lumen
This commit is contained in:
17
backend/app/Models/Caja.php
Normal file
17
backend/app/Models/Caja.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
17
backend/app/Models/Efectivo.php
Normal file
17
backend/app/Models/Efectivo.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
13
backend/app/Models/MedioPago.php
Normal file
13
backend/app/Models/MedioPago.php
Normal 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';
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user