mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
32 lines
887 B
PHP
32 lines
887 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use App\Models\Ssl;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
/** @mixin Ssl */
|
|
class SslResource extends JsonResource
|
|
{
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'server_id' => $this->site->server_id,
|
|
'site_id' => $this->site_id,
|
|
'is_active' => $this->is_active,
|
|
'type' => $this->type,
|
|
'status' => $this->status,
|
|
'log' => $this->log_id ? ServerLogResource::make($this->log) : null,
|
|
'status_color' => Ssl::$statusColors[$this->status] ?? 'secondary',
|
|
'expires_at' => $this->expires_at,
|
|
'created_at' => $this->created_at,
|
|
'updated_at' => $this->updated_at,
|
|
];
|
|
}
|
|
}
|