laravel-nami-api/src/NamiUser.php

48 lines
1.1 KiB
PHP
Raw Normal View History

2020-06-27 23:45:49 +02:00
<?php
namespace Zoomyboy\LaravelNami;
use Illuminate\Contracts\Auth\Authenticatable;
class NamiUser implements Authenticatable {
2021-06-18 19:29:21 +02:00
public $mglnr;
2021-06-18 23:26:21 +02:00
public $password;
2020-06-27 23:45:49 +02:00
2021-06-18 23:26:21 +02:00
public function __construct($payload) {
$this->mglnr = data_get($payload, 'credentials.mglnr');
$this->password = data_get($payload, 'credentials.password');
$this->cookie = data_get($payload, 'cookie');
2020-06-27 23:45:49 +02:00
}
public function getNamiApi() {
2021-04-10 00:28:27 +02:00
return $this->attemptNamiLogin(cache('member.'.$this->mglnr)['credentials']['password']);
2020-06-27 23:45:49 +02:00
}
public function getNamiGroupId() {
return $this->groupid;
}
public function getAuthIdentifierName() {
return 'mglnr';
}
public function getAuthIdentifier() {
return $this->{$this->getAuthIdentifierName()}.'-'.$this->groupid;
}
public function getAuthPassword() {
return null;
}
public function getRememberToken() {
return null;
}
public function setRememberToken($value) {}
public function getRememberTokenName() {
return null;
}
}