2021-10-19 14:35:01 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by Reliese Model.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Carbon\Carbon;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class NhInsurancesSubscription
|
|
|
|
*
|
|
|
|
* @property int $id
|
|
|
|
* @property string $insurance_subscription_id
|
|
|
|
* @property int $network_id
|
|
|
|
* @property int $user_id
|
|
|
|
* @property int $number_of_months
|
|
|
|
* @property float $bonus_amount
|
2021-10-20 13:05:23 +00:00
|
|
|
* @property int $number_of_beneficiaries
|
|
|
|
* @property float $total_bonus_amount
|
2021-10-19 14:35:01 +00:00
|
|
|
* @property string $state
|
|
|
|
* @property Carbon $created_at
|
|
|
|
* @property Carbon $updated_at
|
|
|
|
*
|
|
|
|
* @package App\Models
|
|
|
|
*/
|
|
|
|
class NhInsurancesSubscription extends Model
|
|
|
|
{
|
|
|
|
protected $table = 'nh_insurances_subscriptions';
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
'insurance_subscription_id',
|
|
|
|
'network_id',
|
|
|
|
'user_id',
|
|
|
|
'number_of_months',
|
2021-10-20 13:05:23 +00:00
|
|
|
'total_bonus_amount',
|
2021-10-19 14:35:01 +00:00
|
|
|
'number_of_beneficiaries',
|
|
|
|
'bonus_amount',
|
|
|
|
'state'
|
|
|
|
];
|
|
|
|
|
2021-11-01 14:26:21 +00:00
|
|
|
public function network()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Network::class, 'network_id');
|
|
|
|
}
|
|
|
|
|
2021-10-19 14:35:01 +00:00
|
|
|
public function user()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
|
|
}
|
|
|
|
|
2021-10-29 15:52:10 +00:00
|
|
|
public function beneficiaries()
|
|
|
|
{
|
|
|
|
return $this->hasMany(NhInsurancesHavingRight::class, 'insurance_subscription_id', 'insurance_subscription_id');
|
|
|
|
}
|
|
|
|
|
2021-11-01 14:26:21 +00:00
|
|
|
public function nhNetworkConfig()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(NhNetworksConfig::class, 'network_id', 'network_id');
|
|
|
|
}
|
|
|
|
|
2021-11-10 10:42:05 +00:00
|
|
|
public function payment()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(NhInsurancesPayment::class, 'insurance_subscription_id', 'insurance_subscription_id');
|
|
|
|
}
|
|
|
|
|
2021-10-19 14:35:01 +00:00
|
|
|
}
|