class PamAccount extends Model implements Authenticatable, JWTSubject, RbacUserContract mixin Eloquent

用户账号

Traits

Authenticatable

用户 trait

Authorizable
Notifiable

Constants

TYPE_BACKEND

TYPE_USER

REG_TYPE_USERNAME

REG_TYPE_MOBILE

REG_TYPE_EMAIL

GUARD_WEB

GUARD_BACKEND

GUARD_JWT_BACKEND

GUARD_JWT_WEB

GUARD_JWT

REG_PLATFORM_IOS

REG_PLATFORM_ANDROID

REG_PLATFORM_WEB

REG_PLATFORM_PC

REG_PLATFORM_H5

REG_PLATFORM_WEAPP

REG_PLATFORM_WEBAPP

REG_PLATFORM_MGR

BACKEND_MOBILE_PREFIX

PWD_NUMBER

PWD_CHAR

PWD_CASE

PWD_SPECIAL

Properties

protected $table
protected $dates
protected $fillable
int $id
string $mobile 手机号
string $username 用户名称
string $password 用户密码
string|null $password_key 账号注册时候随机生成的6位key
Carbon $logined_at 登录时间
int $login_times 登录次数
string $reg_ip 注册IP
string $login_ip 当前登录IP
int $parent_id 父ID
int $is_enable 是否启用
string|null $type 类型
string|null $note 用户备注
string|null $email 邮箱
string|null $reg_platform 注册平台
string $disable_reason 禁用原因
string|null $disable_start_at 禁用开始时间
string|null $disable_end_at 禁用结束时间
string $remember_token Token
Carbon $created_at
Carbon $updated_at
PamRoleAccount read-only $role
Collection|PamRole[] read-only $roles

Methods

Collection
cachedRoles()

No description

static 
boot()

No description

BelongsToMany
roles()

Many-to-Many relations with Role.

bool
hasRole($name, bool $require_all = false)

No description

bool
capable($permission, bool $require_all = false)

No description

ability($roles, $permissions, array $options = [])

No description

attachRole($id)

No description

detachRole($id)

No description

static 
clearCachedRoles()

No description

mixed
getJWTIdentifier()

Get the identifier that will be stored in the subject claim of the JWT.

array
getJWTCustomClaims()

Return a key value array, containing any custom claims to be added to the JWT.

static string
passportType(string $passport)

通行证类型(可能返回不匹配的通行证类型)

static string
fullFilledPassport($passport)

补足 86 手机号

static Model|null|object|PamAccount
passport(string|numeric-string|int|float $passport)

根据passport返回Pam

static bool
passportExists($passport)

验证通行证是否存在, 自动补足 86

static Collection
permissions(PamAccount $pam)

获取用户所有的 permission

static array|string
kvType(null|string $key = null, bool $check_key = false)

获取定义的 kv 值

static array|string
kvRegType(null|string|int $key = null, bool $check_key = false)

获取定义的 kv 值

static array|string
kvPlatform(null $key = null, bool $check_exists = false)

注册平台

static PamAccount
instance()

获取账户实例

static string
dftMobile($id)

默认手机号(国际版默认)

static string
beMobile($mobile)

后台手机通行证

static array|string
kvPwdStrength(string $key = null, bool $check_exists = false)

No description

static array
pwdStrength(string $password)

密码策略

Details

in RbacUserTrait at line 24
Collection cachedRoles()

No description

Return Value

Collection

in RbacUserTrait at line 35
static boot()

No description

in RbacUserTrait at line 67
BelongsToMany roles()

Many-to-Many relations with Role.

Return Value

BelongsToMany

in RbacUserTrait at line 83
bool hasRole($name, bool $require_all = false)

No description

Parameters

$name
bool $require_all

Return Value

bool

in RbacUserTrait at line 116
bool capable($permission, bool $require_all = false)

No description

Parameters

$permission
bool $require_all

Return Value

bool

in RbacUserTrait at line 150
ability($roles, $permissions, array $options = [])

No description

Parameters

$roles
$permissions
array $options

in RbacUserTrait at line 217
attachRole($id)

No description

Parameters

$id

in RbacUserTrait at line 226
detachRole($id)

No description

Parameters

$id

in RbacUserTrait at line 233
static protected clearCachedRoles()

No description

at line 122
mixed getJWTIdentifier()

Get the identifier that will be stored in the subject claim of the JWT.

Return Value

mixed

at line 131
array getJWTCustomClaims()

Return a key value array, containing any custom claims to be added to the JWT.

Return Value

array

at line 147
static string passportType(string $passport)

通行证类型(可能返回不匹配的通行证类型)

Parameters

string $passport 通行证

Return Value

string

at line 166
static string fullFilledPassport($passport)

补足 86 手机号

Parameters

$passport

Return Value

string

at line 183
static Model|null|object|PamAccount passport(string|numeric-string|int|float $passport)

根据passport返回Pam

Parameters

string|numeric-string|int|float $passport 通行证

Return Value

Model|null|object|PamAccount

at line 196
static bool passportExists($passport)

验证通行证是否存在, 自动补足 86

Parameters

$passport

Return Value

bool

at line 209
static Collection permissions(PamAccount $pam)

获取用户所有的 permission

Parameters

PamAccount $pam pam

Return Value

Collection

at line 225
static array|string kvType(null|string $key = null, bool $check_key = false)

获取定义的 kv 值

Parameters

null|string $key

需要获取的key, 默认返回整个定义

bool $check_key

检测当前key 是否存在

Return Value

array|string

at line 241
static array|string kvRegType(null|string|int $key = null, bool $check_key = false)

获取定义的 kv 值

Parameters

null|string|int $key

需要获取的key, 默认返回整个定义

bool $check_key

检测当前key 是否存在

Return Value

array|string

at line 258
static array|string kvPlatform(null $key = null, bool $check_exists = false)

注册平台

Parameters

null $key key
bool $check_exists

检测当前key 是否存在

Return Value

array|string

at line 278
static PamAccount instance()

获取账户实例

Return Value

PamAccount

at line 293
static string dftMobile($id)

默认手机号(国际版默认)

Parameters

$id

Return Value

string

at line 304
static string beMobile($mobile)

后台手机通行证

Parameters

$mobile

Return Value

string

at line 315
static array|string kvPwdStrength(string $key = null, bool $check_exists = false)

No description

Parameters

string $key Key
bool $check_exists 检测键值是否存在

Return Value

array|string

at line 331
static array pwdStrength(string $password)

密码策略

Parameters

string $password 密码

Return Value

array