12-05-2026 Frontend dev
This commit is contained in:
parent
405df0a122
commit
313270b55f
777 changed files with 67136 additions and 6241 deletions
41
app/Models/UserPayment.php
Normal file
41
app/Models/UserPayment.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\PaymentStatus;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class UserPayment extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'user_payment_option_id',
|
||||
'amount_cents',
|
||||
'currency',
|
||||
'status',
|
||||
'stripe_charge_id',
|
||||
'stripe_invoice_id',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'amount_cents' => 'integer',
|
||||
'status' => PaymentStatus::class,
|
||||
];
|
||||
}
|
||||
|
||||
public function userPaymentOption(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(UserPaymentOption::class);
|
||||
}
|
||||
|
||||
public function invoices(): HasMany
|
||||
{
|
||||
return $this->hasMany(Invoice::class, 'user_payment_id');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue