For all the methods, that return \Illuminate\Support\Fluent I would like to have IDE suggestions for fluent methods. For example \Illuminate\Database\Schema\Blueprint::integer() would suggest all the methods of \Illuminate\Database\Schema\Blueprint::integer. To achieve this it's easy to add next code in _ide_helper.php:
namespace Jenssegers\Mongodb\Schema {
class Blueprint {
public function integer($column, $autoIncrement = false, $unsigned = false) {
return new static;
}
}
}
Result:

The same for all methods of validators, etc.
+1
+1
Can't you just create a PR and send it in? Just make sure it works well please.
+1. However, the only problem is that it is impossible for a 100% working solution. The Fluent class lets you call any method, set any attribute, etc. even if doing so wouldn't do anything. Its class name is quite fitting; it is fluent in that it can be used for many purposes because it has dynamic capabilities. For example, when you call a method on a Fluent object, it just stores the method name and parameters. It doesn't actually do anything. The programmer (in this case, the Laravel developers) are responsible for using the stored values to actually do what the user of the object intended. Because of its generalized purpose, Fluent is in the \Illuminate\Support namespace.
I don't think that it would hurt to add the standardized "methods" and "attributes" of it. However, Fluent is used in different contexts, so all of the unrelated stuff would still show (which could arguably result in confusion). Laravel IDE Helper doesn't have the power to implement a full solution.
The ideal solution would be for JetBrains to take some of PyCharm's dynamic magic sauce and pour it on PhpStorm.
@tylercrompton I am rather new to Python, but if the idea re PyCharm is viable, could you open a ticket with Jetbrains please?
+1
Please see my comment here
+1
+1
+1
Any chance we can get this included in the ide-helper?
Support for this would be awesome.
Yes I'm using Fluent with some other classes too now and it would be awesome if ide-helper could find out which macros have been registered and then create autocompletion data for that.
Now, you can use 'include_fluent' => true, in your ide-helper config file.
@golubkovden thank you, this solved the problem
Is now default on
Most helpful comment
Now, you can use
'include_fluent' => true,in your ide-helper config file.