artisticre
4 months ago

Some Help With Relationships

Posted 4 months ago by artisticre

I am trying to breakup a long insert statement I had by making 5 separate Models. I broke them up by sections of an employment application. The user can only have one application. Question 1 is do I add the relationships like the following and where do I put them?

public function employmenttype() {
        return $this->hasOne('Employmenttype'); // this matches the Eloquent model
    }

    public function education() {
          return $this->hasOne('Education'); // this matches the Eloquent model
      }
      public function references() {
          return $this->hasOne('References'); // this matches the Eloquent model
      }
      public function employmenthistory() {
        return $this->hasOne('Employmenthistory'); // this matches the Eloquent model
    }
    public function acknowledgement() {
        return $this->hasOne('Acknowledgement'); // this matches the Eloquent model
    }

Please sign in or create an account to participate in this conversation.