mirror of
https://github.com/jez500/pricebuddy.git
synced 2026-11-24 19:58:13 +01:00
31 lines
726 B
PHP
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,
|
|
];
|
|
}
|
|
}
|