官术网_书友最值得收藏!

Setting up your IDE to autocomplete Laravel's namespaces

Most IDEs (Integrated Development Environment) have some form of code completion as part of the program. To get Laravel's namespaces to autocomplete, we may need to help it recognize what the namespaces are.

Getting ready

For this recipe, we'll be adding namespaces to the NetBeans IDE, but the process will be similar with others.

How to do it...

Follow these steps to complete this recipe:

  1. Download the following pre-made file that lists the Laravel namespaces: https://gist.github.com/barryvdh/5227822.
  2. Create a folder anywhere on your computer to hold this file. For our purposes, we'll add the file to C:/ide_helper/ide_helper.php:
  3. After creating a project with the Laravel framework, navigate to File | Project Properties | PHP Include Path:
  4. Click on Add Folder… and then add the folder at C:/ide_helper.
  5. Now when we start typing the code, the IDE will automatically suggest code to complete:

How it works...

Some IDEs need help understanding the syntax of a framework. To get NetBeans to understand, we download a list of all the Laravel classes and options. Then, when we add it to the Include Path, NetBeans will automatically check the file and show us the autocomplete options.

There's more...

We can have the documents downloaded and updated automatically using Composer. For installation instructions, visit https://github.com/barryvdh/laravel-ide-helper.

主站蜘蛛池模板: 孝昌县| 石泉县| 台前县| 彭州市| 乐昌市| 呼和浩特市| 绥中县| 屯留县| 洛南县| 伊金霍洛旗| 德钦县| 上蔡县| 濮阳县| 科尔| 曲靖市| 菏泽市| 兴隆县| 甘孜| 九龙坡区| 桦甸市| 巴南区| 武穴市| 饶阳县| 双桥区| 沂源县| 凉城县| 绥江县| 通城县| 汽车| 龙口市| 婺源县| 昌乐县| 尼勒克县| 藁城市| 丁青县| 和龙市| 库尔勒市| 南京市| 南宁市| 德格县| 永寿县|