<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Notifications\Notifiable;

class Member extends Model
{
    use HasFactory, SoftDeletes, Notifiable;

    public function agent()
    {
        return $this->belongsTo('App\Models\User', 'user_id');
    }

    public function premium()
    {
        return $this->hasOne(premium::class);
    }

    public function premiumPayments(): HasMany
    {
        return $this->hasMany(Premium_payment::class);
    }

    public function group()
    {
        return $this->belongsTo(Group::class, 'group_id');
    }
}
