Files
KanbanGit/app/Http/Resources/UserGitConnectionResource.php
Eric Peters 017cff5437
linter / quality (pull_request) Successful in 1m15s
tests / ci (8.4) (pull_request) Successful in 1m29s
Refactor Inertia responses to use resources
2026-04-15 18:09:08 +02:00

31 lines
883 B
PHP

<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class UserGitConnectionResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'user_id' => $this->user_id,
'provider' => $this->provider->value,
'provider_label' => $this->provider->label(),
'base_url' => $this->base_url,
'provider_user_id' => $this->provider_user_id,
'account_login' => $this->account_login,
'account_name' => $this->account_name,
'created_at' => $this->created_at?->toISOString(),
'updated_at' => $this->updated_at?->toISOString(),
];
}
}