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
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
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
@husniddin Try Once
use Illuminate\Database\Eloquent\Collection;
public function getCompanies(CompanyFilter $filter): Collection
{
return Company::filter($filter)->with(['type'])->get();
}
Please or to participate in this conversation.