Skip to content

Call to an undefined method BelongsToMany::withTrashed() #32487

@psprokofiev

Description

@psprokofiev
  • Laravel Version: 5.7
  • PHP Version: 7.2
  • Database Driver & Version: MySQL 5.7

Description:

I use relations like this

public function experts()
{
    return $this->belongsToMany(Expert::class, 'app_experts', 'app_id', 'expert_id')
                ->withTrashed();
}

All is ok, but php artisan code:analyse tells me that:
Call to an undefined method Illuminate\Database\Eloquent\Relations\BelongsToMany::withTrashed()
What's wrong with it?

If is's important Expert model use SoftDeletes trait.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions