- Laravel Application Development Cookbook
- Terry Matula
- 217字
- 2021-07-23 15:33:32
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:
- Download the following pre-made file that lists the Laravel namespaces: https://gist.github.com/barryvdh/5227822.
- 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
: - After creating a project with the Laravel framework, navigate to File | Project Properties | PHP Include Path:
- Click on Add Folder… and then add the folder at
C:/ide_helper
. - 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.
- 網(wǎng)絡(luò)協(xié)議工程
- 數(shù)字烏托邦
- Hands-On Industrial Internet of Things
- 萬物互聯(lián):蜂窩物聯(lián)網(wǎng)組網(wǎng)技術(shù)詳解
- 走進(jìn)物聯(lián)網(wǎng)
- 無人機(jī)通信
- 局域網(wǎng)組建、管理與維護(hù)項目教程(Windows Server 2003)
- 2018網(wǎng)信發(fā)展報告
- 物聯(lián)網(wǎng)之霧:基于霧計算的智能硬件快速反應(yīng)與安全控制
- Echo Quick Start Guide
- 云工廠:開啟中國制造云時代
- 圖神經(jīng)網(wǎng)絡(luò)前沿
- 移動互聯(lián)網(wǎng)新思維
- 商業(yè)的本質(zhì)和互聯(lián)網(wǎng)
- 智能物聯(lián)安防視頻技術(shù)基礎(chǔ)與應(yīng)用