<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ReferralCommission extends Model
{
    use HasFactory;

    protected $table = 'referral_commissions';

    protected $fillable = [
        'referrer_id',
        'referred_id',
        'amount',
        'type',
        'ip_address',
    ];


    public function referrer()
    {
        return $this->belongsTo(User::class, 'referrer_id');
    }


    public function referredUser()
    {
        return $this->belongsTo(User::class, 'referred_id');
    }
}
