'Customer Shop', 2 => 'Berater Shop', 3 => 'Berater Membership', 4 => 'Berater Wizard', 5 => 'Berater Homeparty', 6 => 'Berater Shop to Customer Shop', ]; public $statuses = [ 0 => 'link_sent', 1 => 'link_openly', 2 => 'link_check', 3 => 'link_pending', 4 => 'link_appointed', 5 => 'link_failed', 6 => 'link_canceled', 10 => 'link_paid', ]; protected $table = 'shopping_instances'; protected $casts = ['shopping_data' => 'array', 'amount' => 'float']; protected $fillable = [ 'identifier', 'user_shop_id', 'auth_user_id', 'status', 'payment', 'subdomain', 'language', 'country_id', 'amount', 'shopping_user_id', 'shopping_data', 'back' ]; public function getStatus(){ return isset($this->statuses[$this->status]) ? $this->statuses[$this->status] : 'link_sent'; } public function getLocale(){ return $this->language ? $this->language : \App::getLocale(); } public function user_shop() { return $this->belongsTo('App\Models\UserShop', 'user_shop_id'); } public function country() { return $this->belongsTo('App\Models\Country', 'country_id'); } //can null public function auth_user() { return $this->belongsTo('App\User','auth_user_id'); } public function getAmountFormatted(){ return formatNumber($this->amount); } }