Integrations

Laravel — where to put the check

Example Written by the BuildAPI team to answer a common question.
BT
BuildAPI team
Example
Question

Middleware or service provider? And does anyone have a sensible way to handle the gateway being down without taking the whole app with it?

BT
BuildAPI team
Example

Middleware, and treat unreachable as allow-with-the-last-known-answer rather than deny. A licensing check that takes your site down when the licensor has an outage is worse than no check.

That's the documented behaviour too — refusal closes the gate immediately, unreachable falls back to the remembered answer until its grace runs out.