Installation and setup
You can install the package via composer:
composer require flowframe/laravel-docs
Setup
To get started:
- Install the package in a Laravel project
- Obtain a GitHub Personal Access Token
- Put the obtained token inside your
.env
:LARAVEL_DOCS_GITHUB_SECRET=<YOUR_TOKEN>
- Add a repository by setting up a webhook which points to your application. Don't forget to use your
LARAVEL_DOCS_GITHUB_SECRET
token. - Push a change to your repository and watch it update
Views
Once installed you should publish the views, by default we provide a simple HTML structure which should give you a rough idea of the working.
Routes
You can specify the route paths via the config.
Config
This is what the default config looks like:
<?php
return [
'webhook_route' => '/webhooks/github/docs/update',
'list_repositories_route' => '/',
'show_doc_route' => '/docs/{repository}/{doc?}',
'github_secret' => env('LARAVEL_DOCS_GITHUB_SECRET'),
];