%PDF- %PDF-
Direktori : /www/loslex/test/app/Workers/ |
Current File : //www/loslex/test/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; } }