Mantenedor de compras!
This commit is contained in:
@@ -11,8 +11,17 @@ class Compra extends Model {
|
||||
use UuidPrimaryKey, SoftDeletes;
|
||||
|
||||
protected $table = 'compras';
|
||||
protected $fillable = [
|
||||
'id', 'fecha_compra', 'proveedor_id', 'en_arqueo', 'restaurante_id'
|
||||
];
|
||||
|
||||
public function compraIngredientes() {
|
||||
public static function findOrFail($id) {
|
||||
$compra = Compra::find($id);
|
||||
if(!$compra) throw new ModelNotFoundException("compra", $id);
|
||||
return $compra;
|
||||
}
|
||||
|
||||
public function ingredientes() {
|
||||
return $this->hasMany(CompraIngrediente::class);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user