1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\Http\Resources\API;
- use App\Models\User;
- use Illuminate\Http\Request;
- use Illuminate\Http\Resources\Json\JsonResource;
- class ApprovalFlowDetailResource extends JsonResource
- {
- /**
- * Transform the resource into an array.
- *
- * @return array<string, mixed>
- */
- public function toArray(Request $request): array
- {
- return [
- "id" => $this->id,
- "name" => $this->name,
- "type" => $this->type,
- "object_type" => $this->object_type,
- "object_id" => $this->object_id==0?null:$this->object_id,
- "nodes" => json_decode($this->nodes_config),
- "status" => $this->status,
- "created_by" => new UserProfileResource($this->createdBy),
- "created_at" => (string)$this->created_at,
- "updated_at" => (string)$this->updated_at,
- ];
- }
- }
|