'int', 'product_id' => 'int', 'comp' => 'int', 'qty' => 'int', 'status' => 'int', ]; protected $fillable = [ 'user_abo_id', 'product_id', 'comp', 'qty', 'status', ]; public function product() { return $this->belongsTo(Product::class); } public function user_abo() { return $this->belongsTo(UserAbo::class); } public function getPrice() { $ufactor = $this->user_abo->is_for === 'me' ? true : false; $tax_free = $ufactor ? true : Yard::instance(\App\Services\AboOrderCart::INSTANCE)->getUserTaxFree(); $userCountry = Yard::instance(\App\Services\AboOrderCart::INSTANCE)->getUserCountry(); return $this->product->getPriceWith($tax_free, $ufactor, $userCountry); } public function getFormattedPrice() { /** der Preis wird für den User berechnet */ return Util::formatNumber($this->getPrice()); } public function getFormattedTotalPrice() { /** der Preis wird für den User berechnet */ return Util::formatNumber($this->getPrice() * $this->qty); } }