Home > Backend Development > PHP Tutorial > Laravel usage manual - use PHPStorm to improve development speed phpstorm 9 registration code phpstorm laravel plug-in phpstorm laravel configuration

Laravel usage manual - use PHPStorm to improve development speed phpstorm 9 registration code phpstorm laravel plug-in phpstorm laravel configuration

WBOY
Release: 2016-07-29 08:52:42
Original
1776 people have browsed it

data-id="1190000004980370" data-licence="">

PHPStorm installation

PHPStorm use manual - see here for installation

code automatic prompt support

laravel introductionlaravel-ide-helpercan provide corresponding support for PHPStorm

<code>composer require barryvdh/laravel-ide-helper</code>
Copy after login

Add the following code to config/app.php

<code>Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,</code>
Copy after login

Build related content:

<code>php artisan ide-helper:generate</code>
Copy after login

Then add the build to composer.jsonConfiguration

<code>"scripts":{
    "post-update-cmd": [
        "php artisan clear-compiled",
        "php artisan ide-helper:generate",
        "php artisan optimize"
    ]
},</code>
Copy after login

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>
Copy after login

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>
Copy after login

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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template