39 lines
1.2 KiB
PHP
39 lines
1.2 KiB
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Http\Resources;
|
||
|
|
|
||
|
|
use Illuminate\Http\Request;
|
||
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||
|
|
|
||
|
|
class SkillResource 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_instructions' => $this->install_instructions,
|
||
|
|
'example_prompt' => $this->example_prompt,
|
||
|
|
'requirements' => $this->requirements,
|
||
|
|
'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,
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|