Skip to content

Releases: surazdott/api-response

v1.2.3

13 Jan 08:12
6f3c78e
Compare
Choose a tag to compare

Added: API response and validation are ignored from exceptions log

v1.2.2

27 Nov 09:46
e55b2c9
Compare
Choose a tag to compare

Added: meta and links key added in paginate api response method

v1.2.1

26 Nov 11:00
f45e4f4
Compare
Choose a tag to compare
  • Removed: Unprocessable method #7
  • Added: Error argument in error method #7

v1.2.0

26 Nov 07:24
Compare
Choose a tag to compare

Added: paginate Helper Method

A new helper method has been added to enhance API response handling:

paginate(string $message, mixed $data = [])

public function index()
{
    $users = UserResource::collection(User::active()->paginate(10));

    return api()->success('Data fetched successfully.', $users);
}
// Result
{
    "success": true,
    "message": "Request processed successfully.",
    "total": 20,
    "total_pages": 2,
    "per_page": 10,
    "data": [
        {
            "id": 1",
            "name": "Suraj....",
        },
        {
            "id": 2",
            "name": "Rabin....",
        }
    ]
}

v1.1.2

25 Nov 06:55
aa3713c
Compare
Choose a tag to compare
  • Refactored the response method to improve its generic usability.
  • Ran all tests successfully on PHP 8.4 to confirm compatibility and functionality.

v1.1.1

25 Sep 12:03
fa0061a
Compare
Choose a tag to compare

feat: Enhance API response handling and error management #4

  • Updated README.md to reflect new API response methods and usage examples.
  • Modified HasApiResponse.php to include new response methods for server and client errors.
  • Updated ApiValidationException.php to improve validation error handling with enhanced messages.
  • Adjusted Api.php facade to incorporate new response methods for clarity and consistency.
  • Refactored ApiResponse.php to introduce generic and specialized response handling (e.g., serverError, success).
  • Enhanced ApiResponseTest.php with additional test cases to cover new response methods.
  • Improved ExceptionTest.php to ensure better exception handling and validation errors.

v1.1.0

23 Sep 06:40
f1ad07f
Compare
Choose a tag to compare
  • Added: Exceptions ApiValidationException and ApiResponseException #2
  • Added: HasApiResponse trait to return API response from request class #2
  • Added: Default translation file #2

v1.0.1

20 Sep 05:49
b6f5e78
Compare
Choose a tag to compare

v1.0.0

19 Sep 17:40
Compare
Choose a tag to compare

Laravel package for HTTP JSON response for API.