protected function setAuthenticationHeader($response, $token = null)
    {
        $token = $token ?: $this->auth->refresh();
        $response->headers->set('Authorization', 'Bearer '.$token);

        return $response;
    }
protected function setAuthenticationHeader($response, $token = null)
    {
        $token = $token ?: $this->auth->refresh();
        $response->headers->set('Authorization', 'Bearer '.$token);

        return $response;
    }
protected function setAuthenticationHeader ( $ response , $ token = null ) { $ token = $ token ? : $ this -> auth -> refresh ( ) ; $ response -> headers -> set ( 'Authorization' , 'Bearer ' . $ token ) ; return $ response ; }
Set the authentication header.

@param  \Illuminate\Http\Response|\Illuminate\Http\JsonResponse  $response
@param  string|null  $token

@return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
Set the authentication header .