Lae/app/View/Components/Payment.php

35 lines
822 B
PHP
Raw Normal View History

2022-11-16 10:06:51 +00:00
<?php
namespace App\View\Components;
use Illuminate\View\Component;
class Payment extends Component
{
2023-02-11 08:48:08 +00:00
public ?string $payment = null;
2022-11-16 10:06:51 +00:00
2023-01-16 20:36:43 +00:00
public function __construct(string|null $payment)
2022-11-16 10:06:51 +00:00
{
$this->payment = $payment;
}
2023-02-12 17:53:59 +00:00
public function render(): string
2022-11-16 10:06:51 +00:00
{
$this->payment = match ($this->payment) {
'alipay' => '支付宝',
'wechat', 'wepay' => '微信支付',
'drops' => 'Drops',
'balance', 'balances' => '余额',
2023-01-17 13:21:47 +00:00
'module_balance', => '模块余额',
2022-11-16 10:06:51 +00:00
'unfreeze' => '解冻',
'freeze' => '冻结',
'console' => '控制台',
'transfer' => '转账',
2023-02-23 02:15:29 +00:00
'affiliate' => '推介',
2022-11-16 10:06:51 +00:00
default => $this->payment,
};
2023-02-12 17:53:59 +00:00
return $this->payment;
2022-11-16 10:06:51 +00:00
}
}