PHP Trait Api\StarterKit\Utils\ApiResponse

Inheritance: use trait Dingo\Api\Routing\Helpers
Show file Open project: qijitech/api-starter-kit

Protected Properties

Property Type Description
$statusCode

Public Methods

Method Description
getStatusCode ( ) : integer
respondBadMethod ( string $message = 'Bad Method!' ) : mixed
respondCreated ( $location = null ) : mixed
respondForbidden ( string $message = 'Forbidden!' ) : mixed
respondInternal ( string $message = 'Internal Server Error!' ) : mixed
respondMethodNotAllowed ( string $message = 'Method Not Allowed!' ) : mixed
respondNotFound ( string $message = 'Not Found!' ) : mixed
respondSuccess ( $message = 'Success' ) : mixed
respondUnprocessable ( $message ) : mixed
respondWithCollection ( Collection $data, League\Fractal\TransformerAbstract $transformer = null ) : mixed
respondWithItem ( $data, League\Fractal\TransformerAbstract $transformer = null ) : mixed
respondWithPagination ( Illuminate\Pagination\AbstractPaginator $paginator, League\Fractal\TransformerAbstract $transformer = null ) : mixed
setStatusCode ( integer $statusCode )

Private Methods

Method Description
getTransformer ( League\Fractal\TransformerAbstract $transformer = null ) : SimpleTransformer | League\Fractal\TransformerAbstract get transformer

Method Details

getStatusCode() public method

public getStatusCode ( ) : integer
return integer

respondBadMethod() public method

public respondBadMethod ( string $message = 'Bad Method!' ) : mixed
$message string
return mixed

respondCreated() public method

public respondCreated ( $location = null ) : mixed
$location
return mixed

respondForbidden() public method

public respondForbidden ( string $message = 'Forbidden!' ) : mixed
$message string
return mixed

respondInternal() public method

public respondInternal ( string $message = 'Internal Server Error!' ) : mixed
$message string
return mixed

respondMethodNotAllowed() public method

public respondMethodNotAllowed ( string $message = 'Method Not Allowed!' ) : mixed
$message string
return mixed

respondNotFound() public method

public respondNotFound ( string $message = 'Not Found!' ) : mixed
$message string
return mixed

respondSuccess() public method

public respondSuccess ( $message = 'Success' ) : mixed
$message
return mixed

respondUnprocessable() public method

public respondUnprocessable ( $message ) : mixed
$message
return mixed

respondWithCollection() public method

public respondWithCollection ( Collection $data, League\Fractal\TransformerAbstract $transformer = null ) : mixed
$data Illuminate\Support\Collection
$transformer League\Fractal\TransformerAbstract
return mixed

respondWithItem() public method

public respondWithItem ( $data, League\Fractal\TransformerAbstract $transformer = null ) : mixed
$data
$transformer League\Fractal\TransformerAbstract
return mixed

respondWithPagination() public method

public respondWithPagination ( Illuminate\Pagination\AbstractPaginator $paginator, League\Fractal\TransformerAbstract $transformer = null ) : mixed
$paginator Illuminate\Pagination\AbstractPaginator
$transformer League\Fractal\TransformerAbstract
return mixed

setStatusCode() public method

public setStatusCode ( integer $statusCode )
$statusCode integer

Property Details

$statusCode protected property

protected $statusCode