feature/columna-totales #4

Open
atasistro wants to merge 46 commits from feature/columna-totales into master
Showing only changes of commit 784b4d97f8 - Show all commits

View file

@ -33,11 +33,15 @@ class Barrio extends Model
return $this->hasMany(Pedido::class); return $this->hasMany(Pedido::class);
} }
function crearPedido(string $nombre) : Pedido {
return $this->pedidos()->create(['name' => $name]);
}
function pedidosConfirmados() { function pedidosConfirmados() {
return $this->pedidos()->where('confirmed',true); return $this->pedidos()->where('confirmed',true);
} }
private function calcularTotalConfirmados($closure = null) : float { private function calcularTotalConfirmados(Closure $closure = null) : float {
if (!$closure) if (!$closure)
$closure = fn($p) => $p->totalChismosa(); $closure = fn($p) => $p->totalChismosa();