"array", ]; public function checkPassword($password): bool { return \Hash::check($password, $this->password); } public function hashPassword($password) { return \Hash::make($password); } public function group() { return $this->belongsTo(AdminGroup::class, "group_id", "id"); } public function company() { return $this->hasOne(UserCompany::class, "user_id", "id"); } public function getAvatarAttribute() { return Arr::get($this->extra, "wechat.avatar", ""); } public function format() { return [ "token" => app(AuthService::class)->encryptToken($this->id), "name" => $this->name, "phone" => $this->phone, "email" => $this->email, ]; } }