Skip to content

Instantly share code, notes, and snippets.

@sagormax
Created October 1, 2018 09:10
Show Gist options
  • Save sagormax/c759eab32add21aec0b0b437b54edf6e to your computer and use it in GitHub Desktop.
Save sagormax/c759eab32add21aec0b0b437b54edf6e to your computer and use it in GitHub Desktop.
HTTP status code
200: OK. The standard success code and default option.
201: Object created. Useful for the store actions.
204: No content. When an action was executed successfully, but there is no content to return.
206: Partial content. Useful when you have to return a paginated list of resources.
400: Bad request. The standard option for requests that fail to pass validation.
401: Unauthorized. The user needs to be authenticated.
403: Forbidden. The user is authenticated, but does not have the permissions to perform an action.
404: Not found. This will be returned automatically by Laravel when the resource is not found.
500: Internal server error. Ideally you're not going to be explicitly returning this, but if something unexpected breaks, this is what your user is going to receive.
503: Service unavailable. Pretty self explanatory, but also another code that is not going to be returned explicitly by the application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment