Download core/app/Models/GatewayCurrency.php from pnacorp/promptlab: direct link, hf CLI and curl.
- Browser
- Download file 772 Bytes
-
https://huggingface.co/pnacorp/promptlab/resolve/main/core/app/Models/GatewayCurrency.php
- Command line
-
hf download hf://pnacorp/promptlab/core/app/Models/GatewayCurrency.php
-
curl -L -o GatewayCurrency.php https://huggingface.co/pnacorp/promptlab/resolve/main/core/app/Models/GatewayCurrency.php
772 Bytes
| namespace App\Models; | |
| use App\Constants\Status; | |
| use Illuminate\Database\Eloquent\Model; | |
| class GatewayCurrency extends Model | |
| { | |
| protected $hidden = [ | |
| 'gateway_parameter' | |
| ]; | |
| protected $casts = ['status' => 'boolean']; | |
| // Relation | |
| public function method() | |
| { | |
| return $this->belongsTo(Gateway::class, 'method_code', 'code'); | |
| } | |
| public function currencyIdentifier() | |
| { | |
| return $this->name ?? $this->method->name . ' ' . $this->currency; | |
| } | |
| public function scopeBaseCurrency() | |
| { | |
| return $this->method->crypto == Status::ENABLE ? 'USD' : $this->currency; | |
| } | |
| public function scopeBaseSymbol() | |
| { | |
| return $this->method->crypto == Status::ENABLE ? '$' : $this->symbol; | |
| } | |
| } | |