shalvah пре 6 година
родитељ
комит
8f2c36358a
1 измењених фајлова са 28 додато и 3 уклоњено
  1. 28 3
      README.md

+ 28 - 3
README.md

@@ -14,19 +14,31 @@ Automatically generate your API documentation from your existing Laravel/Lumen/[
 > Note: this is the documentation for version 3, which changes significantly from version 2. if you're on v2, you can check out its documentation [here](https://github.com/mpociot/laravel-apidoc-generator/blob/2.x/README.md). We strongly recommend you upgrade, though, as v3 is more robust and fixes a lot of the problems with v2.
 
 ## Installation
-> Note: version 3.x requires PHP 7 and Laravel 5.5 or higher.
+> Note: PHP 7 and Laravel 5.5 or higher are required.
 
 ```sh
 $ composer require mpociot/laravel-apidoc-generator:dev-master
 ```
 
-Then publish the config file by running:
+### Laravel
+Publish the config file by running:
 
 ```bash
 php artisan vendor:publish --provider=Mpociot\ApiDoc\ApiDocGeneratorServiceProvider --tag=config
 ```
 This will create an `apidoc.php` file in your `config` folder.
 
+### Lumen
+- Register the service provider in your `bootstrap/app.php`:
+```php
+$app->register(\Mpociot\ApiDoc\ApiDocGeneratorServiceProvider::class);
+```
+- Copy the config file from `vendor/mpociot/laravel-apidoc-generator/config/apidoc.php` to your project as `config/apidoc.php`. Then add to your `bootstrap/app.php`:
+```php
+$app->configure('apidoc');
+```
+
+
 ## Usage
 Before you can generate your documentation, you'll need to configure a few things in your `config/apidoc.php`.
 - `output`
@@ -38,6 +50,9 @@ Set this option to true if you want a Postman collection to be generated along w
 - `router`
 The router to use when processing the route (can be Laravel or Dingo. Defaults to **Laravel**)
 
+- `logo`
+You can specify your custom logo to be used on the generated documentation. Set the `logo` option to an absolute path pointing to your logo file.
+
 - `routes`
 This is where you specify what rules documentation should be generated for. You specify routes to be parsed by defining conditions that the routes should meet and rules that should be applied when generating documentation. These conditions and rules are specified in groups, allowing you to apply different rules to different routes.
 
@@ -174,7 +189,7 @@ class UserController extends Controller
 
 To specify a list of valid parameters your API route accepts, use the `@bodyParam` and `@queryParam` annotations.
 - The `@bodyParam` annotation takes the name of the parameter, its type, an optional "required" label, and then its description.
-- The `@queryParam` annotation (coming soon!) takes the name of the parameter, an optional "required" label, and then its description
+- The `@queryParam` annotation takes the name of the parameter, an optional "required" label, and then its description
 
 
 ```php
@@ -189,6 +204,16 @@ public function createPost()
 {
     // ...
 }
+
+/**
+ * @queryParam sort Field to sort by
+ * @queryParam page The page number to return
+ * @queryParam fields required The fields to include
+ */
+public function listPosts()
+{
+    // ...
+}
 ```
 
 They will be included in the generated documentation text and example requests.