Skip to content

Commit 92226ed

Browse files
authored
Merge pull request #368 from vanderbake/master
Add custom logo support
2 parents 96f998a + 50edba8 commit 92226ed

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

config/apidoc.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,15 @@
143143
],
144144
],
145145
],
146+
147+
/*
148+
* Custom logo path. Will be copied during generate command. Set this to false to use the default logo.
149+
*
150+
* Change to an absolute path to use your custom logo. For example:
151+
* 'logo' => resource_path('views') . '/api/logo.png'
152+
*
153+
* If you want to use this, please be aware of the following rules:
154+
* - size: 230 x 52
155+
*/
156+
'logo' => false,
146157
];

src/Commands/GenerateDocumentation.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Mpociot\Reflection\DocBlock;
99
use Illuminate\Support\Collection;
1010
use Mpociot\ApiDoc\Tools\RouteMatcher;
11+
use Illuminate\Support\Facades\Storage;
1112
use Mpociot\ApiDoc\Generators\Generator;
1213
use Mpociot\Documentarian\Documentarian;
1314
use Mpociot\ApiDoc\Postman\CollectionWriter;
@@ -169,6 +170,13 @@ private function writeMarkdown($parsedRoutes)
169170

170171
file_put_contents($outputPath.DIRECTORY_SEPARATOR.'collection.json', $this->generatePostmanCollection($parsedRoutes));
171172
}
173+
174+
if ($logo = config('apidoc.logo')) {
175+
Storage::copy(
176+
$logo,
177+
$outputPath.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'logo.png'
178+
);
179+
}
172180
}
173181

174182
/**

0 commit comments

Comments
 (0)