08 2024
This commit is contained in:
parent
04d677d37a
commit
bfa3bb1df4
1191 changed files with 637397 additions and 10619 deletions
|
|
@ -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')){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue