Programster's Blog

Tutorials focusing on Linux, programming, and open-source

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

If this tutorial becomes out of date, and that file no longer works, I grabbed it from the Laravel 5 IDE Helper Generator Github repository, which will probably have info on what to do.

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

Netbeans users, don't forget to run this step to enable auto[complete etc.

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

Last updated: 27th August 2018
First published: 16th August 2018

This blog is created by Stuart Page

I'm a freelance web developer and technology consultant based in Surrey, UK, with over 10 years experience in web development, DevOps, Linux Administration, and IT solutions.

Need support with your infrastructure or web services?

Get in touch