belongsTo(Currency::class); } public function getCurrencyNameAttribute() { return $this->currency()->value('name'); } public function getPriceAttribute() { $BindBox = BindBox::where('code',$this->attributes['code'])->first(); if (!empty($BindBox)) { return $BindBox->price; } return ''; } public function getImageAttribute() { $BindBox = BindBox::where('code',$this->attributes['code'])->first(); if (!empty($BindBox)) { return $BindBox->image; } return ''; } public function getEndTimeAttribute() { $BindBox = BindBox::where('code',$this->attributes['code'])->first(); if (!empty($BindBox)) { return $BindBox->end_time; } return ''; } public function getNameAttribute() { $BindBox = BindBox::where('code',$this->attributes['code'])->first(); if (!empty($BindBox)) { return $BindBox->name; } return ''; } }