<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;

class ReferalCodeHistory extends Model
{
     use Notifiable , SoftDeletes;

 # define table
  protected $table ='referal_code_history';
  
  # define fillable fields
  protected $fillable = [
  	                   'user_id',
  	                   'referal_codes_id',
  	                   'status',
                       
  ];

     /**
   * The attributes that should be cast.
   *
   * @var array
   */
  protected $casts = [
      'status'  => 'boolean',
  ];
    public function referalCode()
    {
       
        return $this->hasOne(new ReferalCode(), 'id', 'referal_codes_id');
    }
    public function user()
    {
       
        return $this->hasOne(new Users(), 'id', 'user_id');
    }
}
