data-id="1190000004980370" data-licence="">
PHPStorm installation
PHPStorm use manual - see here for installation
code automatic prompt support
laravel introductionlaravel-ide-helper
can provide corresponding support for PHPStorm
<code>composer require barryvdh/laravel-ide-helper</code>
Add the following code to config/app.php
<code>Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,</code>
Build related content:
<code>php artisan ide-helper:generate</code>
Then add the build to composer.json
Configuration
<code>"scripts":{ "post-update-cmd": [ "php artisan clear-compiled", "php artisan ide-helper:generate", "php artisan optimize" ] },</code>
Complete the above steps and you can happily use the code in PHPStorm Automatically prompted, please see laravel-ide-helper for the rest of the configuration
Use Swagger to provide API documentation
Using Swagger can provide a set of automatic document generation solutions, and effectively solve communication problems such as front-end and back-end work delivery.
To install Swagger support and Swagger-ui in Laravel, please go to laravel usage guide - Swagger.
Installing and supporting
<code>菜单栏 File -> Setting -> Plugins -> Browse repositories 搜索 PHP Annotations Plugin 和 Symfony2 Plugin 安装</code>
in PHPStorm. When using it, you don’t need to completely refer to the laravel plug-in zircote/swagger-php
. You can use PHPStorm to automatically complete the content format, that is:
<code>##Swagger-php建设的备注格式 /** * @SWG\Info(title="My First API", version="0.1") */ /** * @SWG\Get( * path="/api/resource.json", * @SWG\Response(resp/api/resource.json", * @SWG\Response(resp description="An example resource") * ) */</code>
Swagger summary
From Swagger The official documentation shows that PHPStorm supports the optional PHP Annotations Plugin
and Symfony2 Plugin
. After testing, it was found that the PHP Annotations Plugin
must be installed to make good use of the note completion function.
The above introduces the laravel usage manual - using PHPStorm to improve development speed, including phpstorm and laravel content. I hope it will be helpful to friends who are interested in PHP tutorials.