12345678910111213141516171819202122232425 |
- <?php
- namespace App\Http\Resources\API;
- use Illuminate\Http\Request;
- use Illuminate\Http\Resources\Json\JsonResource;
- class ActionByApprovalLogResource extends JsonResource
- {
- /**
- * Transform the resource into an array.
- *
- * @return array<string, mixed>
- */
- public function toArray(Request $request): array
- {
- return [
- 'action' => $this->action,
- 'action_label' => __('action-labels.label.' . $this->action),
- 'comment' => $this->comment,
- 'created_at' => (string)$this->created_at,
- 'created_by' => new UserProfileResource($this->createdBy),
- ];
- }
- }
|