public function toArray()
    {
        return array_merge([
            'user' => $this->key,
            'device' => implode(',', $this->devices),
        ], $this->token ? ['token' => $this->token] : []);
    }