Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.MarcinOrlowski:laravel-api-response-builder:'
}
dependencies {
implementation("com.github.MarcinOrlowski:laravel-api-response-builder:")
}
<dependency>
<groupId>com.github.MarcinOrlowski</groupId>
<artifactId>laravel-api-response-builder</artifactId>
<version></version>
</dependency>
libraryDependencies += "com.github.MarcinOrlowski" % "laravel-api-response-builder" % ""
:dependencies [[com.github.MarcinOrlowski/laravel-api-response-builder ""]]
ResponseBuilder
is a Laravel package, designed to help you build a nice, normalized and easy to consume
REST API JSON responses.
ResponseBuilder
is written for REST API developers by REST API developers, drawing from extensive experience on both
sides of API development. It's lightweight, with no dependencies, thoroughly tested, and simple to use while remaining
flexible and powerful. It offers support for on-the-fly data conversion, localization,
automatic message building, chained APIs, and comprehensive documentation.
Moreover, the JSON structure produced by ResponseBuilder
is designed with your API users in mind. Its
well-defined and predictable structure makes interacting with your API using
ResponseBuilder
effortless. The simple, consistent JSON responses are easy to consume without any complications.
Your clients will appreciate it, and by extension, appreciate you as well!
You're also covered in case of emergencies. The provided ExceptionHandlerHelper ensures your API continues to communicate in JSON (not HTML) with its clients, even in unexpected situations.
Did I mention, you would also get testing traits that automatically add PHPUnit based unit test to your
whole ResponseBuilder
related code and configuration with just a few lines of code absolutely free of charge?