<?php

namespace App\Repositories\Eloquent;

use App\Models\Payment;
use App\Repositories\Interfaces\PaymentRepositoryInterface;

class PaymentRepository extends BaseRepository implements PaymentRepositoryInterface
{
    /**
    * PaymentRepository constructor.
    *
    * @param Payment $model
    */
    public function __construct(Payment $model)
    {
       parent::__construct($model);
    }

    public function getBookingLatestPayment($bookingId)
    {
        return $this->model
            ->where('booking_id', $bookingId)
            ->orderBy('id', 'desc')
            ->first();
    }
}
