<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth;

class Friend extends Model
{
    protected $fillable = ['sender_request', 'user_id', 'status'];

    public function user()
    {
        if ($this->sender_request == Auth::id()) {
            return User::find($this->user_id);
        } else {
            return User::find($this->sender_request);
        }
    }
}
