EscolaLMS/payments

View on GitHub
src/Http/Responses/PaymentResponse.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php

namespace EscolaLms\Payments\Http\Responses;

use EscolaLms\Payments\Http\Resources\PaymentResource;
use EscolaLms\Payments\Models\Payment;
use Illuminate\Contracts\Support\Responsable;

class PaymentResponse implements Responsable
{
    private Payment $payment;

    public function __construct(Payment $payment)
    {
        $this->payment = $payment;
    }

    public function toResponse($request)
    {
        return PaymentResource::make($this->payment)->toResponse($request);
    }
}