App\Libraries\Utils::getNewsFeedResponse PHP Method

getNewsFeedResponse() public static method

public static getNewsFeedResponse ( $userType = false )
    public static function getNewsFeedResponse($userType = false)
    {
        if (!$userType) {
            $userType = Utils::getUserType();
        }
        $response = new stdClass();
        $response->message = isset($_ENV["{$userType}_MESSAGE"]) ? $_ENV["{$userType}_MESSAGE"] : '';
        $response->id = isset($_ENV["{$userType}_ID"]) ? $_ENV["{$userType}_ID"] : '';
        $response->version = NINJA_VERSION;
        return $response;
    }

Usage Example

 public function newsFeed($userType, $version)
 {
     $response = Utils::getNewsFeedResponse($userType);
     return Response::json($response);
 }