Last updated 4 years ago
API response can be many lines of code unless using a helper method.
Helper::response() accepts 3 parameters
status code
message
data
Example of returning success data
Example of returning error data
Helper::response(200,'This is success message!',$data);
Helper::response(401,'This is error message!',null);