PHP Class App\Http\Controllers\Front\Api\Controller

Inheritance: extends App\Http\Controllers\Controller
Datei anzeigen Open project: spatie-custom/blender

Protected Properties

Property Type Description
$statusCode integer

Public Methods

Method Description
getStatusCode ( ) : integer
respond ( array $data, array $headers = [] ) : Illuminate\Http\JsonResponse Set a response.
respondWithBadRequest ( string $message = 'Bad Request' ) : Illuminate\Http\Response Send a response with a bad request.
respondWithError ( string $message ) : Illuminate\Http\JsonResponse Respond with an error message.
respondWithInternalServerError ( string $message = 'Internal Server Error' ) : Illuminate\Http\Response Send a response with a internal server error code.
setStatusCode ( integer $statusCode )

Method Details

getStatusCode() public method

public getStatusCode ( ) : integer
return integer

respond() public method

Set a response.
public respond ( array $data, array $headers = [] ) : Illuminate\Http\JsonResponse
$data array
$headers array
return Illuminate\Http\JsonResponse

respondWithBadRequest() public method

Send a response with a bad request.
public respondWithBadRequest ( string $message = 'Bad Request' ) : Illuminate\Http\Response
$message string
return Illuminate\Http\Response

respondWithError() public method

Respond with an error message.
public respondWithError ( string $message ) : Illuminate\Http\JsonResponse
$message string
return Illuminate\Http\JsonResponse

respondWithInternalServerError() public method

Send a response with a internal server error code.
public respondWithInternalServerError ( string $message = 'Internal Server Error' ) : Illuminate\Http\Response
$message string
return Illuminate\Http\Response

setStatusCode() public method

public setStatusCode ( integer $statusCode )
$statusCode integer

Property Details

$statusCode protected_oe property

protected int $statusCode
return integer