This commit is contained in:
Kevin Adametz 2024-08-05 12:05:24 +02:00
parent 04d677d37a
commit bfa3bb1df4
1191 changed files with 637397 additions and 10619 deletions

View file

@ -76,6 +76,7 @@ class UserShop extends Model
protected $casts = [
'featured' => 'array',
'trans' => 'array',
];
protected $fillable = [
@ -114,6 +115,29 @@ class UserShop extends Model
return Carbon::parse($this->attributes['active_date'])->format("d.m.Y");
}
public function getLang($key, $default = true)
{
$lang = \App::getLocale();
if ($lang == 'de') {
return $this->{$key};
}
return $this->getTrans($key, $lang, $default);
}
public function getTrans($key, $lang, $default = true)
{
if ($lang == 'de') {
return $this->{$key};
}
if(!empty($this->trans[$lang][$key])){
return $this->trans[$lang][$key];
}
if($default){
return !empty($this->{$key}) ? $this->{$key} : '';
}
return "";
}
public function getSubdomain($session=true)
{
if($session && \Session::has('user_shop_domain')){