Files
2025-09-07 11:14:54 +10:00

31 lines
726 B
PHP

<?php
namespace App\Http\Resources;
use App\Models\Url;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
/**
* @property Url $resource
*/
class UrlResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->resource->getKey(),
'url' => $this->resource->url,
'product_id' => $this->resource->product_id,
'store_id' => $this->resource->store_id,
'created_at' => $this->resource->created_at,
'updated_at' => $this->resource->updated_at,
];
}
}