initial: bootstrap from BukidBountyApp base
This commit is contained in:
45
app/Models/Subscription/SubscriptionInvoice.php
Normal file
45
app/Models/Subscription/SubscriptionInvoice.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models\Subscription;
|
||||
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
use App\Models\User;
|
||||
|
||||
class SubscriptionInvoice extends Model
|
||||
{
|
||||
protected ?string $table = 'subscription_invoices';
|
||||
|
||||
public bool $incrementing = true;
|
||||
|
||||
protected array $fillable = [
|
||||
'hashkey',
|
||||
'subscription_id',
|
||||
'user_id',
|
||||
'amount',
|
||||
'status',
|
||||
'paid_at',
|
||||
'payment_method',
|
||||
'payment_reference',
|
||||
'additional_details',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
|
||||
protected array $casts = [
|
||||
'amount' => 'float',
|
||||
'paid_at' => 'datetime',
|
||||
'additional_details' => 'array',
|
||||
];
|
||||
|
||||
public function subscription()
|
||||
{
|
||||
return $this->belongsTo(Subscription::class, 'subscription_id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user