A Laravel middleware package that adds authentication protection to your Scribe API documentation. This package provides a simple way to secure your API documentation with basic authentication, ensuring that only authorized users can access your API documentation pages.
- Scribe's
type
config should be set tolaravel
in yourconfig/scribe.php
file. - Scribe's
laravel->add_routes
config should be set totrue
in yourconfig/scribe.php
file.
- Install the package via Composer:
composer require oralunal/scribe-auth
- Add the
web
andscribe.auth
middleware to yourconfig/scribe.php
file:
'middleware' => [
// ...
'web',
'scribe.auth',
],
- Publish the configuration file:
php artisan vendor:publish --tag=scribe-auth-config
The package comes with a config file (config/scribe-auth.php
) where you can customize the following settings:
SCRIBE_AUTH_ENABLED
: Enable/disable the middleware (Default:false
)SCRIBE_AUTH_PASSWORD
: Authentication password (Default:1234567890
)
Add the following environment variable to your .env
file:
SCRIBE_AUTH_ENABLED=true
SCRIBE_AUTH_PASSWORD=your_fantastic_password
- Use different credentials in production
- Choose a strong password
- Keep your credentials secure
This package is open-sourced software licensed under the MIT license.