src/Alexa.php
public function device($attributes = [])
    {
        if (!$this->isAlexaRequest()) {
            return;
        }

        if (!is_null($this->device)) {
            return $this->device;
        }

        if (!array_key_exists($this->alexaConfig['device']['device_identifier'], $attributes)) {
            $attributes[$this->alexaConfig['device']['device_identifier']] = $this->alexaRequest->getUserId();
        }

        $result = $this->deviceProvider->retrieveByCredentials($attributes);

        if ($result instanceof AmazonEchoDevice) {
            $this->device = $result;
        }

        return $result;
    }
public function device($attributes = [])
    {
        if (!$this->isAlexaRequest()) {
            return;
        }

        if (!is_null($this->device)) {
            return $this->device;
        }

        if (!array_key_exists($this->alexaConfig['device']['device_identifier'], $attributes)) {
            $attributes[$this->alexaConfig['device']['device_identifier']] = $this->alexaRequest->getUserId();
        }

        $result = $this->deviceProvider->retrieveByCredentials($attributes);

        if ($result instanceof AmazonEchoDevice) {
            $this->device = $result;
        }

        return $result;
    }
@param array $attributes

@return \Develpr\AlexaApp\Contracts\AmazonEchoDevice|null