Skip to content

Commit

Permalink
feat: added new error function in base controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Dipesh79 committed Apr 10, 2024
1 parent 46636b6 commit 66f5373
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Controller/ApiBaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,15 @@ public function api_error($data)
'message' => $data->getMessage()
], $data->getCode());
}

public function custom_error($status,$message)
{
return response()->json(
[
'status' => $status,
'data' => [],
'message' => $message
], $status
);
}
}

0 comments on commit 66f5373

Please sign in to comment.