Whenever we use Model static methods such as "Where", "find", etc. return instance is of mixed type, it makes method hinting and checking method usage from model becomes difficult in large projects.
example:
class School extends Model {
public function students()
{
return $this->hasMany(Students::class);
}
}
$company = Company::find(1); // this returns mixed type instead of Company
$students = $company->students();
navigating directly from ->students() is not possible for mixed type,
also searching usage from model is not possible.
@neilstee I agree on dd() we'll get Company Instance, but when you'll hover the cursor over $company variable it will show you mixed type, also you'll not get method suggestion as you get for stricted type hinted variable.
also if you do find all reference of student method in vs code, you won't find $company->students(); in the results