Support the ongoing development of Laravel.io →
posted 10 years ago
Eloquent
Last updated 2 years ago.
0

Well immediately after posting I figured this one out...

In User model:

public function department()
{
  return $this->belongsTo('Department');
}

In Department model:

public function manager()
{
  return $this->hasOne('User', 'id', 'manager_id');
}

public function director()
{
  return $this->hasOne('User', 'id', 'director_id');
}
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

a2thek26 a2thek26 Joined 10 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.