<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Models\BaseModel;

class LoginAttempt extends BaseModel
{
    use HasFactory;

    protected $table = 'login_or_signup_attempt';

    public $timestamps = false;

    public function getRouteKeyName()
    {
        return 'uid';
    }

    public function displayName()
    {
        if ($this->full_name) return $this->full_name;
        if($this->name_first || $this->name_last){
           return $this->name_first . ' ' . $this->name_last; 
        }
        return $this->email;
    }
}
