37 lines
822 B
PHP
37 lines
822 B
PHP
<?php
|
|
|
|
namespace Modules\Authentication\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class SubscriptionUpgradeRequest extends Model
|
|
{
|
|
protected $fillable = [
|
|
'restaurant_id',
|
|
'package_id',
|
|
'extra_days',
|
|
'amount_paid',
|
|
'payment_method',
|
|
'notes',
|
|
'status',
|
|
'approved_by',
|
|
'approved_at',
|
|
];
|
|
|
|
public function restaurant(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Restaurant::class)->select('id', 'name');
|
|
}
|
|
|
|
public function package(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Package::class)->select('id', 'name', 'price', 'duration');
|
|
}
|
|
|
|
public function approver(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'approved_by');
|
|
}
|
|
}
|