Allow configuration of domain
for any Scramble route
#720
Closed
stayallive
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Hey @stayallive That is possible now using this way (https://scramble.dedoc.co/usage/getting-started#using-expose-configuration-method): public function boot()
{
Scramble::configure()
->expose(
ui: fn (Router $router, $action) => $router
->domain('docs.example.com')
->get('docs/v1/api', $action),
document: fn (Router $router, $action) => $router
->domain('docs.example.com')
->get('docs/v1/openapi.json', $action),
);
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A
config('scramble.domain')
could be enough for most if not all use cases (see for example Laravel Horizon). Not all apps run on a single domain and having routes without a domain defined is usually fine but not always.For example in my app there are custom domains who serve my customers and I would like to prevent exposing my API doc routes on those domains.
From what I can tell this is currently impossible to achieve unless you don't let Scramble do any route generation and implement all of them "manually" by defining your own routes and handlers.
Beta Was this translation helpful? Give feedback.
All reactions