ProjectResource.php 730 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?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 [
            'payment_id' => $this->payment_id,
            'status' => $this->status,
            'amount_received' => $this->amount_received,
            'target_amount' => $this->target_amount,
            'percentage_funded' => $this->percentage_funded,
23
24
            'qrcode' => ['base64' => base64_encode($this->qrcode)],
            'contributions' => $this->contributions,
25
26
27
        ];
    }
}