Skip to content

Instantly share code, notes, and snippets.

@ddavaham
Created October 3, 2018 03:47
Show Gist options
  • Save ddavaham/2a71773b8f364a7769aced56fb4f96b7 to your computer and use it in GitHub Desktop.
Save ddavaham/2a71773b8f364a7769aced56fb4f96b7 to your computer and use it in GitHub Desktop.
<?php
namespace SUN\Models;
use SUN\Traits\HasPermissionsTrait;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use SUN\Models\ESI\{Character, Contract, MailHeader, MailingList, Station, Structure, Type};
class Member extends Authenticatable
{
use Notifiable;
protected $primaryKey = 'id';
protected $table = 'members';
public $incrementing = false;
protected static $unguarded = true;
protected $dates = [
'expires', 'last_online', 'disabled_timestamp'
];
protected $with = [
'info'
];
public function getRememberToken()
{
return null; // not supported
}
public function setRememberToken($value)
{
// not supported
}
public function getRememberTokenName()
{
return null; // not supported
}
/**
* Overrides the method to ignore the remember token.
*/
public function setAttribute($key, $value)
{
$isRememberTokenAttribute = $key == $this->getRememberTokenName();
if (!$isRememberTokenAttribute)
{
parent::setAttribute($key, $value);
}
}
// ****************************************************************************************************
// *************************************** Character Information Relationships ************************
// ****************************************************************************************************
public function info()
{
return $this->hasOne(Character::class, 'id', 'id');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment