2021-07-04 16:56:07 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Payment;
|
|
|
|
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
|
2022-01-02 12:32:57 +01:00
|
|
|
/**
|
|
|
|
* @mixin Payment
|
|
|
|
*/
|
2021-07-04 16:56:07 +02:00
|
|
|
class PaymentResource extends JsonResource
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Transform the resource into an array.
|
|
|
|
*
|
2022-03-11 20:19:17 +01:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
*
|
2021-07-04 16:56:07 +02:00
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function toArray($request)
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'subscription_id' => $this->subscription_id,
|
|
|
|
'subscription_name' => $this->subscription->name,
|
|
|
|
'status_name' => $this->status->name,
|
|
|
|
'status_id' => $this->status->id,
|
|
|
|
'nr' => $this->nr,
|
|
|
|
'id' => $this->id,
|
2021-07-04 17:03:56 +02:00
|
|
|
'is_accepted' => $this->status->isAccepted(),
|
2021-07-04 16:56:07 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|