Laravel-ide-helper: class '' not found

Created on 12 Sep 2016  路  4Comments  路  Source: barryvdh/laravel-ide-helper

hi,
i'm having issue when running
php artisan ide-helper:model

error generated

> D:\TKBARUPHP>php artisan ide-helper:model
> 
>  Do you want to overwrite the existing model files? Choose no to write to _ide_helper_models.php instead? (Yes/No):  (yes/no) [no]:
>  > y
> 
> Written new phpDocBlock to D:\TKBARUPHP\app\Bank.php
> Written new phpDocBlock to D:\TKBARUPHP\app\Customer.php
> PHP Fatal error:  Class 'product' not found in D:\TKBARUPHP\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php on line 780
> 
> 
>   [Symfony\Component\Debug\Exception\FatalErrorException]
>   Class 'product' not found
> 
> 
> 
> D:\TKBARUPHP>

i'm using laravel 5.3, ide-helper 2.2.1

Most helpful comment

@GitzJoey try to do so on relations

public function relation()
{
    return $this->belongsTo(Model::class);
}

instead of

public function relation()
{
    return $this->belongsTo('model');
}

All 4 comments

same error here

@GitzJoey try to do so on relations

public function relation()
{
    return $this->belongsTo(Model::class);
}

instead of

public function relation()
{
    return $this->belongsTo('model');
}

@cristianvuolo thank you very much for the solution.

@barryvdh pretty sure this was a "app bug", I think this one can be closed :}

Was this page helpful?
0 / 5 - 0 ratings