6
0
Fork 0
jiqu-library-server/app/Endpoint/Api/Http/Resources/CouponResource.php

27 lines
705 B
PHP

<?php
namespace App\Endpoint\Api\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class CouponResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
*/
public function toArray($request)
{
return [
'id' => $this->id,
'name' => $this->name,
'type' => $this->type,
'amount' => $this->amount,
'threshold' => $this->threshold,
// 'receive_status' => $this->whenLoaded('likesInfo', $this->likesInfo->count() > 0),
];
}
}