This commit is contained in:
2025-09-25 03:03:31 +05:00
commit ae480cf2f6
2768 changed files with 1485826 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Http\Controllers\Api\V1\Carousel\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class CarouselResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->whenHas('id'),
'title' => $this->whenHas('title'),
'place' => $this->whenHas('place'),
'app' => $this->whenHas('app'),
'link' => $this->whenHas('link'),
'resource_id' => $this->whenHas('resource_id'),
'resource_type' => $this->whenHas('resource_type'),
'thumbnail' => $this->thumbnail('650x650'),
'image' => $this->getFirstMediaUrl('main'),
];
}
}