fedi-feed-router/app/Http/Resources/PlatformAccountResource.php
myrmidex d2919758f5
All checks were successful
CI / ci (push) Successful in 5m52s
CI / ci (pull_request) Successful in 5m46s
Build and Push Docker Image / build (push) Successful in 4m6s
Fix Pint 1.29.0 lint issues and update CI workflow
2026-03-18 20:01:25 +01:00

38 lines
1 KiB
PHP

<?php
namespace App\Http\Resources;
use App\Models\PlatformAccount;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
/**
* @mixin PlatformAccount
*/
/**
* @mixin PlatformAccount
*/
class PlatformAccountResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'platform' => $this->platform->value,
'instance_url' => $this->instance_url,
'username' => $this->username,
'settings' => $this->settings,
'is_active' => $this->is_active,
'last_tested_at' => $this->last_tested_at?->toISOString(),
'status' => $this->status,
'created_at' => $this->created_at->toISOString(),
'updated_at' => $this->updated_at->toISOString(),
'channels' => PlatformChannelResource::collection($this->whenLoaded('channels')),
];
}
}