src/Priskz/SORAD/Responder/AbstractResponder.php
public function getApiContext($prefix = false)
	{
		if(empty($this->apiContext))
		{
			return $this->apiContext;
		}

		// Note: Laravel will convert view periods into directory slashes.
		//       So we can easily interchange . with /
		$apiContextExplode = explode('/', $this->apiContext);

		// Remove 2nd segment if it exists, assuming it is an identifier.
		unset($apiContextExplode[1]);

		// Transform back into a string.
		$genericApiContext = implode('/', $apiContextExplode);

		if($prefix)
		{	
			return $genericApiContext . '/';
		}

		return $this->apiContext;	
	}
public function getApiContext($prefix = false)
	{
		if(empty($this->apiContext))
		{
			return $this->apiContext;
		}

		// Note: Laravel will convert view periods into directory slashes.
		//       So we can easily interchange . with /
		$apiContextExplode = explode('/', $this->apiContext);

		// Remove 2nd segment if it exists, assuming it is an identifier.
		unset($apiContextExplode[1]);

		// Transform back into a string.
		$genericApiContext = implode('/', $apiContextExplode);

		if($prefix)
		{	
			return $genericApiContext . '/';
		}

		return $this->apiContext;	
	}
public function getApiContext ( $ prefix = false ) { if ( empty ( $ this -> apiContext ) ) { return $ this -> apiContext ; } // Note: Laravel will convert view periods into directory slashes. //       So we can easily interchange . with / $ apiContextExplode = explode ( '/' , $ this -> apiContext ) ; // Remove 2nd segment if it exists, assuming it is an identifier. unset ( $ apiContextExplode [ 1 ] ) ; // Transform back into a string. $ genericApiContext = implode ( '/' , $ apiContextExplode ) ; if ( $ prefix ) { return $ genericApiContext . '/' ; } return $ this -> apiContext ; }
Get API Context

@param  $string $prefix Format string for view string.
@return string
Get API Context