Skip to content

Commit 2146fa1

Browse files
committed
Fix #509 - No forceRootURL method in Lumen
1 parent 793f15a commit 2146fa1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Commands/GenerateDocumentation.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ public function __construct(RouteMatcher $routeMatcher)
4747
*/
4848
public function handle()
4949
{
50-
URL::forceRootUrl(config('app.url'));
50+
try {
51+
URL::forceRootUrl(config('app.url'));
52+
} catch (\Exception $e) {
53+
echo "Warning: Couldn't force base url as Lumen currently doesn't have the forceRootUrl method.\n";
54+
echo "You should probably double check URLs in your generated documentation.\n";
55+
}
5156
$usingDingoRouter = strtolower(config('apidoc.router')) == 'dingo';
5257
if ($usingDingoRouter) {
5358
$routes = $this->routeMatcher->getDingoRoutesToBeDocumented(config('apidoc.routes'));

0 commit comments

Comments
 (0)