<?php
namespace Koselig\Models;
use Illuminate\Auth\Authenticatable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class User extends Model implements AuthenticatableContract
{
use Authenticatable;
protected $table = DB_PREFIX . 'users';
protected $primaryKey = 'ID';
protected $dates = ['user_registered'];
public $timestamps = false;
public function posts()
{
return $this->hasMany(Post::class, 'post_author');
}
public function getAuthPassword()
{
return $this->user_pass;
}
public function link()
{
return get_author_posts_url($this->ID, $this->display_name);
}
}