-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Labels
Description
Laravel Version
v11.31.0
PHP Version
8.3.8
Database Driver & Version
8.3.8 for macOs
Description
Relation returns collection instead of eloquent after minor laravel update.
This applies only when using methods ->though(xxx)->has(yyy)
, but not when using ->hasOneThrough

Steps To Reproduce
Just setup simple has one trough relation according to documentation.

My code
Student.php
class Student extends Model
{
public function termine()
{
return $this->through('terminesPivot')
->has('termine');
}
StudentsTerminesPivot.php
class StudentsTerminesPivot extends Pivot
{
public $table = 'termine_student_termines';
public function termine()
{
return $this->hasOne(Termine::class, 'id', 'termine_id');
}
}
Termine.php
class Termine extends Model
{
}