%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/loslex/production/app/Workers/
Upload File :
Create Path :
Current File : /www/loslex/production/app/Workers/AccountNote.php

<?php

namespace App\Workers;

use App\Models\User;
use Illuminate\Support\Str;

class AccountNote
{
    protected string $paymentnote;

    protected $placeholders = array(
        '%jmeno%',
        '%name%',
        '%losalias%'
    );

    protected $replacement = array();

    function __construct(string $accnote, User $user = null)
    {
        $this->paymentnote = $accnote;
        $this->user = $user;

        $this->replacement = array(
            $this->user?->displayname ?? __('Name'),
            $this->user?->displayname ?? __('Name'),
            $this->user?->username ?? __('LOS alias'),
        );
    }

    public function getPaymentNote()
    {
        $retval = Str::of(str_replace($this->placeholders, $this->replacement, $this->paymentnote));
        return $retval;
    }

    public function getQRPaymentNote()
    {
        $retval = $this->getPaymentNote()->limit(60, '')->upper()->ascii();
        return $retval;
    }
}

Zerion Mini Shell 1.0