Netbeans - Adding Support for Laravel
When I first found out about Laravel, I was super excited about this new (at the time) framework, especially because there were all these lovely video tutorials (Laracasts) to learn from. However, I was quickly disappointed due to lack of auto completion and hinting in Netbeans. I just gave up thinking that the framework was for those willing to pay out for PhpStorm.
Luckily, there is a way around this, and you can get auto-complete/hinting in Netbeans as shown in the image below (where I am editing the web routes file).
The Solution
The solution is to download a "helper file" inside your Laravel project, which will provide the information Netbeans needs. Run the following command from inside your project in order to download this helper file.
wget https://gist.githubusercontent.com/barryvdh/5227822/raw/4be028a27c4ec782965bb8f2fdcb4c08c71a441d/_ide_helper.php
Installing Laravel
Just a reminder; if you are setting up a laravel project, you can create it with the following command:
composer create-project laravel/laravel my-project-name-goes-here --prefer-dist
Adding To .gitignore
If you are a git user, you may wish to add it to your .gitignore, but then again maybe others could benefit from having it.
echo "_ide_helper.php" >> .gitignore
References
- Laracasts - Episode 15
- Github - barryvdh/laravel-ide-helper
- Github Gist - barryvdh/_ide_helper.php
- Youtube - Learning Laravel 5.2 Series- NetBeans IDE and Important Plugins for Laravel Development video - 3
First published: 16th August 2018