<?php

namespace App\Models;

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

class Referral extends Model
{
    use HasFactory;

    protected $fillable = ['user_id', 'referral_id', 'reward'];

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

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