Closed ElvenSpellmaker closed 2 years ago
Did you check the config file or docs? https://scribe.knuckles.wtf/blog/2021/06/08/laravel-v3#multiple-urls
@shalvah Yeah I checked the docs, didn't realise it'd be in a section about multiple URLs because I don't have multiple URLs.
Either way this doesn't fix my problem because it seems to put the URL into blade at build time and not at runtime which makes me rather stuck now.
Edit: Here's the config for those three URLs:
...
'base_url' => null,
...
'try_it_out' => [
'enabled' => true,
'base_url' => null,
'use_csrf' => false,
'csrf_url' => '/sanctum/csrf-cookie',
]
...
Edit 2: I don't have permissions to reopen the issue.
Not really, Scribe is fairly extensible, so you're hardly ever "stuck". Yes, it puts the URLs in at build time. We could change that for Laravel
type, but that would be extra complexity and not everyone would want to use APP_URL.
However, you can override the default templates and replace the URL part with your dynamic version. There's a section in the docs about customising.
Oh, another option: you could use the afterGenerating()
hook to do a search and replace.
What happened?
type => 'laravel',
php artisan scribe:generate
and it generates the blade templateinstead of using APP_URL at render time.
The problem we have is that we build a Docker image one and use it later and don't have the URLs at the build time and so hardcoded URL from the
.env
isn't appropriate.E.g. APP_URL is set to the correct URL on the container, however examples etc are all using the value from
.env
at build time:My environment:
php -v
): N/Acomposer show knuckleswtf/scribe
): latest stable