Files
omg-wtf-ai/app/Http/Resources/McpServerResource.php
2026-08-11 00:42:46 +03:00

42 lines
1.3 KiB
PHP

<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class McpServerResource extends JsonResource
{
/**
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'name' => $this->name,
'slug' => $this->slug,
'description' => $this->description,
'url' => $this->url,
'docs_url' => $this->docs_url,
'logo_url' => $this->logo_url,
'category' => $this->category,
'category_label' => $this->category_label,
'install_command' => $this->install_command,
'config_example' => $this->config_example,
'transport' => $this->transport,
'transport_label' => $this->transport_label,
'language' => $this->language,
'capabilities' => $this->capabilities,
'tags' => $this->tags,
'views' => $this->views,
'clicks' => $this->clicks,
'featured' => $this->featured,
'approved' => $this->approved,
'submitted_by' => new UserResource($this->whenLoaded('user')),
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}