Download the PHP package bulatronic/api-kit without Composer

On this page you can find all versions of the php package bulatronic/api-kit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package api-kit

ApiKit Symfony Bundle

PHP Version Symfony Version

A minimalist Symfony Bundle for building REST APIs with standardized responses, automatic exception handling, and DTO validation.

Key Features

Architecture Compatibility

ApiKit only standardizes the HTTP layer — responses and exception handling. It has no opinion on how the rest of your application is organized.

Architecture How ApiKit fits
Layered / Traditional Controller → Service → Repository. Controllers use AbstractApiController, services throw exceptions.
DDD ApiKit lives in the infrastructure/presentation layer. The domain knows nothing about it — domain services throw standard PHP exceptions, ExceptionListener catches them outside.
Hexagonal (Ports & Adapters) AbstractApiController is a driving adapter. The application core (ports + domain) has zero dependency on ApiKit.
Vertical Slice Architecture ApiControllerTrait is the natural fit — each slice is an independent class with no shared inheritance. The trait adds respond* methods without forcing a class hierarchy.

Before & After

Without ApiKit — boilerplate in every controller:

With ApiKit — one line, same result:

Validation, exception handling, and logging are handled automatically and uniformly across all endpoints.

Installation

The bundle is automatically registered via Symfony Flex.

Quick Start

1. Create a DTO

2. Create a Controller

Two options — pick one:

Option A: extend AbstractApiController (simplest, when you don't extend another class):

Option B: use ApiControllerTrait (when you already extend another class):

3. Throw Errors from Services — No try/catch Needed

ExceptionListener catches everything automatically. Your controller stays clean:

4. Standardized Response Format

Success (200):

Validation error (422) — from #[MapRequestPayload]:

ApiException error (409):

Reference

AbstractApiController / ApiControllerTrait Methods

ResponseFactory (inject as dependency)

ApiException

EntityExists Validator

Requires Doctrine ORM:

Exception Handling

ExceptionListener handles automatically (no try/catch in controllers needed):

Exception HTTP Status Notes
ValidationFailedException 422 From #[MapRequestPayload] or manual
HttpException(*, prev: ValidationFailed) Same as exception Violations extracted
ApiException Configured code getDetails() included in response
Any HttpExceptionInterface Status from exception Standard Symfony exceptions
Any other \Throwable 500 Logged; trace shown in debug mode

Configuration

Create config/packages/api_kit.yaml (optional — sensible defaults work out of the box):

Testing

Requirements

Optional:

Documentation

License

MIT — see LICENSE.

Author

Bulat Timerbaev[email protected]


All versions of api-kit with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
symfony/event-dispatcher Version ^7.4|^8.1.1
symfony/framework-bundle Version ^7.4|^8.1.1
symfony/http-foundation Version ^7.4|^8.1.1
symfony/serializer Version ^7.4|^8.1.1
symfony/validator Version ^7.4|~8.0.14
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bulatronic/api-kit contains the following files

Loading the files please wait ...