28 lines
722 B
PHP
28 lines
722 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class ProductoResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'nombre' => $this->nombre,
|
|
'descripcion' => $this->descripcion,
|
|
'codigo_barras' => $this->codigo_barras,
|
|
'precio_compra' => $this->precio_compra,
|
|
'precio_venta' => $this->precio_venta,
|
|
'stock' => $this->stock,
|
|
'categoria_id' => $this->categoria_id,
|
|
'estado' => $this->estado,
|
|
];
|
|
}
|
|
}
|