Skip to content

6.6.0

Choose a tag to compare

@binaryk binaryk released this 02 Feb 17:08
· 26 commits to 6.x since this release
a67e5e2

Motivation

Restify already provides powerful filters and get routes with relationships. However, sometimes you might want to get some extra data for your repositories.

Let's say you have a stripe user. This is how you retrieve the stripe user information through a get request:

Route::get('users/stripe-information', UserStripeController::class);

// UserStripeController.php

public function __invoke(Request $request)
{
  ...
}

The classic approach is good, however, it has a few limitations. Firstly, you have to manually take care of the route middleware, the testability for these endpoints should be done separately which is hard to maintain. And finally, the endpoint is disconnected from the repository, which makes it feel out of context so has a bad readability.

So, code readability, testability and maintainability become hard.

See more: https://restify.binarcode.com/api/getters