<?php

namespace App\Models;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Model;

class Partner extends Authenticatable
{
    use HasFactory, Notifiable;

    function creator(){
        return $this->hasOne('App\Model\User', 'id', 'created_by');
    }

    function getCreator(){
        if(!$this->creator){
            return new User;
        }
        return $this->creator;
    }

    function lastupdator(){
        return $this->hasOne('App\Model\User', 'id', 'updated_by');
    }

    function getLastupdator(){
        if(!$this->lastupdator){
            return new User;
        }
        return $this->lastupdator;
    }
}
