21 lines
535 B
PHP
21 lines
535 B
PHP
<?php
|
|
|
|
namespace App\Domains\Product\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class FeaturedProductResource extends JsonResource
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'featured_group_id' => $this->featured_group_id,
|
|
'product_id' => $this->product_id,
|
|
'order' => $this->order,
|
|
// You can add a nested ProductResource here if needed and when loaded
|
|
];
|
|
}
|
|
}
|