There's quite a few changes in Scribe, and this guide aims to show you the key parts you need to look out for so things don't break. After migrating, you should also check out the list of new features.
composer remove mpociot/laravel-apidoc-generator
composer install knuckleswtf/scribe
php artisan vendor:publish --provider="Knuckles\Scribe\ScribeServiceProvider" --tag=scribe-config
At this point, you should have both apidoc.php and scribe.php in your config folder. This is good, so ou can easily copy your old config over and delete when you're done.
If you've modified your generated Blade views, you should also publish the new ones:
php artisan vendor:publish --provider="Knuckles\Scribe\ScribeServiceProvider" --tag=scribe-views
⚠ IMPORTANT: If you've modified the generated Markdown or added prepend/append files, you should copy them to a separate folder (not in
resources/docs
). After generating the new docs, you'll have to manually add your changes in.
After you've done all of the above, delete your resources/docs/
and public/docs
folders, to prevent any conflicts with the new ones we'll generate. If you're using laravel
type output, you can also delete resources/views/apidoc/
.
laravel.autoload
key is now laravel.add_routes
, and is true
by default.resources/docs
. The route files are located in resources/docs/groups
and are split by groups (1 group per file).rebuild
command has been removed. By default, when you run php artisan scribe:generate
, Scribe will not overwrite any Markdown files you've modified. If you want Scribe to do so, run with --force
.logo
is now false
by default, so no logo spot will be shown. Relative paths and URLs are now supported too.It's a new package with a different name, so a few things have changed. This section is especially important if you've written any custom strategies or extended any of the provided classes.
Mpociot\ApiDoc\Strategies
with Knuckles\Scribe\Extracting
Mpociot\ApiDoc\Strategies\RequestHeaders
with Knuckles\Scribe\Extracting\Strategies\Headers
Mpociot\ApiDoc
with Knuckles\Scribe
$method
argument to the __invoke
method from ReflectionMethod
to ReflectionFunctionAbstract
. It's a superclass, so every other thing should work fine.public $stage
property and set it to the name of the stage the strategy belongs to. If you have a constructor defined, remove the $stage
argument from it.requestHeaders
stage has been renamed to headers
.That should be all. Head on to the list of new features to see what's new. If you come across anything we've missed, please send in a PR!