This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 267435

Summary: Laravel Object Type
Product: ide Reporter: spad87
Component: CodeAssignee: issues@ide <issues>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Windows 10   
Issue Type: ENHANCEMENT Exception Reporter:

Description spad87 2016-08-04 23:50:37 UTC
I'm using NetBeans to work on a Laravel 5 project.
Despite other custom project I worked on, I’m not able to make the IDE understand the type of objects.

For example, I have a class “Page” that extends “Illuminate\Database\Eloquent\Model”. If I wrote:
$page = Page::where(“title”, “temp”)->first();
the variable $page now is an object of Page class, so I should be able to have intellisense suggesting me attributes and methods: 
$page->[autocomplete_here]
but nothing happens. 

If I write:
$page = new Page(); 
now I’m able to see the suggestions (but I can’t use this form due to the way Laravel works). 

Another workaround I found is to define the variable in a comment just before using it:
/* @var $page Page */
but this is impossible to do every time a need a new object.

Is there a way to make NetBeans understands the type of the variable automatically from the first example? Is it clear what I mean?

Thank you for your support,
Fabio