@@ -30,37 +30,51 @@ passing PHPUnit tests.
3030
31311 . Install the package using the following command: ` composer require ronasit/laravel-swagger `
3232
33- > *** Note***
34- >
35- > For Laravel 5.5 or later the package will be auto-discovered.
36- > For older versions add the ` AutoDocServiceProvider ` to the
37- > providers array in ` config/app.php ` as follow:
38- >
39- > ``` php
40- > 'providers' => [
41- > // ...
42- > RonasIT\AutoDoc\AutoDocServiceProvider::class,
43- > ],
44- > ```
45-
46- 1. Run `php artisan vendor:publish`
47- 2. Add `\RonasIT\AutoDoc\Http\Middleware\AutoDocMiddleware::class` middleware to the global HTTP middleware stack in `Http/Kernel.php`.
48- 3. Add `\RonasIT\AutoDoc\Tests\AutoDocTestCaseTrait` trait to `tests/TestCase.php`
49- 4. Configure documentation saving using one of the next ways:
50- - Add `SwaggerExtension` to the `<extensions >` block of your `phpunit.xml`.
51- **Please note that this way will be removed after updating**
52- **PHPUnit up to 10 version (https://github.com/sebastianbergmann/phpunit/issues/4676)**
53- ```xml
54- <extensions >
55- <extension class =" RonasIT\AutoDoc\Tests\PhpUnitExtensions\SwaggerExtension" />
56- </extensions >
57- <testsuites >
58- <testsuite name =" Feature" >
59- <directory suffix =" Test.php" >./tests/Feature</directory >
60- </testsuite >
61- </testsuites >
62- ```
63- - Call `php artisan swagger:push-documentation` console command after
33+ > *** Note***
34+ >
35+ > For Laravel 5.5 or later the package will be auto-discovered.
36+ > For older versions add the ` AutoDocServiceProvider ` to the
37+ > providers array in ` config/app.php ` as follow:
38+ >
39+ > ``` php
40+ > 'providers' => [
41+ > ...
42+ > RonasIT\AutoDoc\AutoDocServiceProvider::class,
43+ > ],
44+ > ```
45+
46+ 2. Run `php artisan vendor:publish --provider=RonasIT\\AutoDoc\\AutoDocServiceProvider`
47+ 1. Add `\RonasIT\AutoDoc\Http\Middleware\AutoDocMiddleware::class` middleware to the global HTTP middleware list `bootstrap\app.php`:
48+
49+ ```php
50+ return Application::configure(basePath: dirname(__DIR__))
51+ ->withMiddleware(function (Middleware $middleware) {
52+ $middleware->use([
53+ ...
54+ \RonasIT\AutoDoc\Http\Middleware\AutoDocMiddleware::class,
55+ ]);
56+ });
57+ ```
58+
59+ 4 . Add ` \RonasIT\AutoDoc\Traits\AutoDocTestCaseTrait ` trait to ` tests/TestCase.php `
60+ 1 . Configure documentation saving using one of the next ways:
61+ - Add ` SwaggerExtension ` to the ` <extensions> ` block of your ` phpunit.xml ` .
62+ ** Please note that this way will be removed after updating**
63+ ** PHPUnit up to 10 version (https://github.com/sebastianbergmann/phpunit/issues/4676 )**
64+
65+ ``` xml
66+ <phpunit >
67+ <extensions >
68+ <bootstrap class =" RonasIT\AutoDoc\Support\PHPUnit\Extensions\SwaggerExtension" />
69+ </extensions >
70+ <testsuites >
71+ <testsuite name =" Feature" >
72+ <directory suffix =" Test.php" >./tests/Feature</directory >
73+ </testsuite >
74+ </testsuites >
75+ </phpunit >
76+ ```
77+ - Call ` php artisan swagger:push-documentation ` console command after
6478 the ` tests ` stage in your CI/CD configuration
6579
6680## Usage
@@ -120,7 +134,7 @@ passing PHPUnit tests.
120134 >
121135 > For correct working of plugin you'll have to dispose all the validation rules
122136 > in the `rules()` method of your request class. Also, your request class
123- > must be connected to the controller via [dependency injection](https://laravel.com/docs/9 .x/container#introduction).
137+ > must be connected to the controller via [dependency injection](https://laravel.com/docs/11 .x/container#introduction).
124138 > Plugin will take validation rules from the request class and generate fields description
125139 > of input parameter.
126140
@@ -191,7 +205,7 @@ You can use the following annotations in your request classes to customize docum
191205
192206### Custom driver
193207
194- You can specify the way to collect documentation by creating your own custom driver.
208+ You can specify the way to collect and view documentation by creating your own custom driver.
195209
196210You can find example of drivers [here](https://github.com/RonasIT/laravel-swagger/tree/master/src/Drivers).
197211
@@ -206,6 +220,10 @@ This change is reflected immediately, without the need to rebuild the documentat
206220The package supports the integration of the primary documentation with additional valid
207221OpenAPI files specified in the `additional_paths` configuration.
208222
223+ ## Migration guides
224+
225+ [3.0.1-beta](MIGRATION-GUIDES.md#301-beta)
226+
209227## Contributing
210228
211229Thank you for considering contributing to Laravel Swagger plugin! The contribution guide
0 commit comments