asset('openapi.yaml'), // Beside the specification because it is the same contract, and // whoever is here is the person who needs it: generated with // `php artisan api:types`, absent if it was never generated. 'types' => file_exists(public_path('api-types.d.ts')) ? asset('api-types.d.ts') : null, // "Try it out" must call the installation you are actually // looking at, not the canonical one in the configuration — the // same page is opened on a laptop, on staging and in production. 'apiBase' => url('/api'), 'server' => $request->getHost(), 'environment' => (string) config('app.env'), ]); } }