'boolean', 'active' => 'boolean', 'meta' => 'object', 'unit_amount' => 'float', 'sale_unit_amount' => 'float', 'interval_count' => 'integer', 'trial_period_days' => 'integer', ]; public function purchasable() { return $this->morphTo(); } public function scopeIsActive($query) { return $query->where('active', true); } public function getCurrentPrice($sale_price): float { if ($sale_price) { return $this->sale_unit_amount; } return $this->unit_amount; } }