point-backend/app/Http/Resources/website/WebProjectResource.php
KarimAldeen cf43e0b8d0 Done
2024-04-17 00:25:45 +03:00

31 lines
704 B
PHP

<?php
namespace App\Http\Resources\website;
use App\Http\Resources\dashboard\ProjectImageResource;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class WebProjectResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
"id"=> $this->id,
'title' => $this->title,
'description' => $this->description,
'logo' => $this->logo ,
'type' => $this->type,
'images' => ProjectImageResource::collection($this->whenLoaded('images')),
];
}
}