hasMany(TestUser::class, 'parent_id'); } public function pets() { return $this->belongsToMany(TestPet::class)->withPivot('duration'); } public function work() { return $this->belongsTo(TestWork::class, 'test_work_id'); } }