Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Husniddin's avatar

Laravel Idea return type problem

I just bought Laravel idea. Now my functions warning that return type is wrong

How can I fix it?

    public function getCompanies(CompanyFilter $filter): Company
    {
        return Company::filter($filter)->with(['type'])->paginated();
    }

Return value is expected to be '\App\Models\Company', '\LaravelIdea\Helper\App\Models_IH_Company_QB' returned

1 like
1 reply
Vishal007's avatar
Vishal007
Best Answer
Level 1

@husniddin Try Once

use Illuminate\Database\Eloquent\Collection;

public function getCompanies(CompanyFilter $filter): Collection
{
    return Company::filter($filter)->with(['type'])->get();
}
1 like

Please or to participate in this conversation.