up
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?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,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user