hasOne(Account::class); } public function user_companies() { return $this->hasMany(UserCompany::class); } public function contacts() { return $this->hasMany(Contact::class); } public function owns($entity) { return ! empty($entity->user_id) && $entity->user_id == $this->id; } }