File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -34,30 +34,36 @@ public static function instance()
3434 /**
3535 * Sets data for success response.
3636 *
37- * @param mixed $data Data to return on response
37+ * @param mixed $data Data to return on response
38+ * @param mixed $httpStatus
3839 *
3940 * @return self
4041 */
41- public static function success ($ data )
42+ public static function success ($ data, $ httpStatus = 200 )
4243 {
4344 self ::$ _data = $ data ;
4445 self ::$ _status = self ::SUCCESS ;
4546
47+ self ::$ _httpStatus = $ httpStatus ;
48+
4649 return self ::instance ();
4750 }
4851
4952 /**
5053 * Sets data for error response.
5154 *
52- * @param mixed $data Data to return on response
55+ * @param mixed $data Data to return on response
56+ * @param mixed $httpStatus
5357 *
5458 * @return self
5559 */
56- public static function error ($ data )
60+ public static function error ($ data, $ httpStatus = 400 )
5761 {
5862 self ::$ _data = $ data ;
5963 self ::$ _status = self ::ERROR ;
6064
65+ self ::$ _httpStatus = $ httpStatus ;
66+
6167 return self ::instance ();
6268 }
6369
You can’t perform that action at this time.
0 commit comments