mirror of
https://github.com/jez500/pricebuddy.git
synced 2026-11-24 19:58:13 +01:00
30 lines
659 B
PHP
30 lines
659 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use App\Models\Store;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
/**
|
|
* @property Store $resource
|
|
*/
|
|
class StoreResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->resource->getKey(),
|
|
'name' => $this->resource->name,
|
|
'slug' => $this->resource->slug,
|
|
'initials' => $this->resource->initials,
|
|
'domains' => $this->resource->domains,
|
|
];
|
|
}
|
|
}
|