<?php

namespace App\Http\Livewire\Frontend\User;

use App\Models\PaymentManagement\Payment;
use Livewire\Component;

class PaymentsComponent extends Component{

    public $showPayment = false;
    public $selectedPayment;

    public function displayPayment($paymentId){
        $this->selectedPayment = auth_customer()->payments()->with('method',"usages")->find($paymentId);
        $this->showPayment = true;
    }

    public function render(){
        return view('livewire.frontend.user.payments-component', [
            'payments' => auth_customer()->payments()->visibles()->get()
        ]);
    }
}
