mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 06:56:15 +00:00
#591 - sites
This commit is contained in:
31
app/Http/Resources/SslResource.php
Normal file
31
app/Http/Resources/SslResource.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?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,
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user