presseportale/app/Models/PaymentOption.php
Kevin Adametz 5b8bdf4182
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (push) Waiting to run
12-05-2026 Frontend dev
2026-05-12 18:32:33 +02:00

45 lines
1 KiB
PHP

<?php
namespace App\Models;
use App\Enums\PaymentOptionType;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
class PaymentOption extends Model
{
use HasFactory, SoftDeletes;
protected $fillable = [
'article_number',
'type',
'price_cents',
'currency',
'interval',
'is_hidden',
'stripe_product_id',
'stripe_price_id',
];
protected function casts(): array
{
return [
'type' => PaymentOptionType::class,
'price_cents' => 'integer',
'is_hidden' => 'boolean',
'deleted_at' => 'datetime',
];
}
public function translations(): HasMany
{
return $this->hasMany(PaymentOptionTranslation::class);
}
public function userPaymentOptions(): HasMany
{
return $this->hasMany(UserPaymentOption::class);
}
}