Closed yanghoxom closed 3 weeks ago
@mixin
is supported in premium only. Eloquent
is generated by the ide_helper package. If it is not found then it must not be in your workspace.
@bmewburn but I already import by use Eloquent
, Doesn't it have any effect?
The file that declares Eloquent must not be in your workspace or is not indexed for some reason.
@bmewburn
I added a license, I can use premium features.
but errors related to extends Eloquent
still remaining
FYI
this is a file sample
<?php
declare(strict_types=1);
namespace App\Models;
use Eloquent;
/**
...
* @mixin Eloquent
*/
final class Book extends Eloquent
{
....
public function attachments(): HasMany
{
return $this->hasMany(BookAttachment::class);
}
...
}
->hasMany
throw Undefined method
extends Eloquent
throw Undefined type
Where is the file that declares Eloquent
?
@bmewburn
it is an extra class
it comes from ide-helper.php
https://github.com/barryvdh/laravel-ide-helper/blob/master/config/ide-helper.php#L183
Right, so where is that file in your workspace?
@bmewburn Thank you, you are right
I forgot to run php artisan ide-helper:generate
to create _ide_helper.php
everything is OK right now
Describe the bug if I extend from Eloquent for a model, I will have some method/property that can not "look up" by this extension and show error
I'm not sure if this issue is related to the premium feature
mixin
or not I don't have license ide-helper auto-add@mixin Eloquent
to PHPDOC but even if I remove that line, the error still continues to showThe error is fixed if I switch to
extends Model
as usual. but to be honest, most of the project isextending Eloquent
, I don't want to change the whole project just to fix extension related display errorsTo Reproduce
this thing will show errors
Expected behavior It shouldn't show any error because my code working well
Screenshots
![image](https://github.com/bmewburn/vscode-intelephense/assets/10399540/20868f62-1045-48c9-8857-6f30a657c66c)
Platform and version PHP intelephense 1.10.4 vscode 1.87.2