« Documentation table of contents
- Installataion
To install ResponseBuilder
all you need to do is to open your shell/cmd and do:
composer require marcin-orlowski/laravel-api-response-builder
To install specific version, use
composer require marcin-orlowski/laravel-api-response-builder:<VERSION>
where <VERSION>
string consists of MAJOR
and MINOR
release numbers.
For example if you want to use version 6.3, you need to invoke:
composer require marcin-orlowski/laravel-api-response-builder:9.3
which will add the dependency at the release 9.3 + all the bug-fixing releases (9.3.*
) but won't
automatically pull 9.4 (nor newer) even if available, unless composer.json
is updated manually.
If you want to use different configuration than ResponseBuilder
defaults, publish and edit
configuration file as described in Configuration file documentation.
ResponseBuilder
supports Laravel's auto-discovery feature and it's ready to use once installed.
ResponseBuilder
looks for
config/response_builder.php
configuration file.
It's advised to publish default config file to application's config/
directory on installation
and then tweak it as needed:
php artisan vendor:publish
If you are going to use Exception Handler Helper, you MUST configure it first in your config file (esp.
default
handler configuration)!