forked from nathalie/pedi2
29 lines
776 B
PHP
29 lines
776 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Resources;
|
||
|
|
||
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||
|
|
||
|
class SubpedidoResource extends JsonResource
|
||
|
{
|
||
|
/**
|
||
|
* Transform the resource into an array.
|
||
|
*
|
||
|
* @param \Illuminate\Http\Request $request
|
||
|
* @return array
|
||
|
*/
|
||
|
public function toArray($request)
|
||
|
{
|
||
|
return [
|
||
|
'id' => $this->id,
|
||
|
'nombre' => $this->nombre,
|
||
|
'subtotal_productos' => $this->getSubtotalProductos(),
|
||
|
'subtotal_bonos' => $this->getSubtotalBonos(),
|
||
|
'bonos_de_transporte' => $this->cantidadBDT(),
|
||
|
'subtotal_bonos_de_transporte' => $this->getSubtotalBDT(),
|
||
|
'total' => $this->getTotal(),
|
||
|
'grupo_de_compra' => $this->grupoDeCompra
|
||
|
];
|
||
|
}
|
||
|
}
|