31 lines
765 B
PHP
31 lines
765 B
PHP
<?php
|
|
|
|
namespace App\Domains\Product\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
/**
|
|
* @mixin \App\Domains\Product\Models\Product
|
|
*/
|
|
class ProductResource extends JsonResource
|
|
{
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'tenant_codigo' => $this->tenant_codigo,
|
|
'categoria_id' => $this->categoria_id,
|
|
'slug' => $this->slug,
|
|
'nombre' => $this->nombre,
|
|
'descripcion' => $this->descripcion,
|
|
'precio' => $this->precio,
|
|
'created_at' => $this->created_at,
|
|
'updated_at' => $this->updated_at,
|
|
];
|
|
}
|
|
}
|