mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/tickme.git
synced 2026-08-22 22:14:15 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ProjectResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'type_id' => $this->type_id,
|
||||
'project_type' => $this->projectType->name,
|
||||
'client_id' => $this->client_id,
|
||||
'client' => new ClientResource($this->client),
|
||||
'reference' => $this->reference,
|
||||
'description' => $this->description,
|
||||
'status' => $this->status,
|
||||
'current_status' => $this->currentStatus->name
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user