Aplikasi Keuangan yang mengatur lalu lintas transaksi antara bank dan aplikasi internal Kampus
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

32 lines
901 B

<?php
namespace App\Domains\System\Models;
use Exception;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;
use Illuminate\Database\Eloquent\Model;
#[Fillable(['key', 'value', 'type'])]
#[WithoutTimestamps]
class SystemSettings extends Model
{
public static string $cacheName = 'system-settings';
/**
* @throws Exception
*/
public function getTranslatedValueAttribute(): ?string
{
$key = $this->attributes['type']::tryFrom($this->attributes['key']);
$schema = $key->schema();
if ($schema->type->isFile() && isset($this->attributes['value'])) {
return asset_static($this->attributes['value']);
} elseif ($schema->type->isSelect()) {
return $schema->options[$this->attributes['value']];
}
return $this->attributes['value'];
}
}