mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 15:02:34 +00:00
API Feature (#334)
This commit is contained in:
28
app/Http/Resources/ServiceResource.php
Normal file
28
app/Http/Resources/ServiceResource.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Models\Service;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
/** @mixin Service */
|
||||
class ServiceResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'server_id' => $this->server_id,
|
||||
'type' => $this->type,
|
||||
'type_data' => $this->type_data,
|
||||
'name' => $this->name,
|
||||
'version' => $this->version,
|
||||
'unit' => $this->unit,
|
||||
'status' => $this->status,
|
||||
'is_default' => $this->is_default,
|
||||
'created_at' => $this->created_at,
|
||||
'updated_at' => $this->updated_at,
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user