title: Laravel best way to save data one to one relationships?
body: <p>Terms table:</p>
  
  <ul>
  <li>term_id</li>
  <li>name</li>
  <li>slug</li>
  </ul>
  
  <p>Term_taxonomy table:</p>
  
  <ul>
  <li>term_taxonomy_id</li>
  <li>term_id</li>
  <li>description</li>
  </ul>
  
  <p>My Term model:</p>
  
  <pre><code>public function TermTaxonomy(){
      return $this-&gt;hasOne('TermTaxonomy');
  }
  
  public function saveCategory($data){
      $validator = Validator::make($data,$this-&gt;rules);
      if($validator-&gt;passes()){
          $this-&gt;name = $data['name'];
          $this-&gt;slug = $data['slug'];
          if($this-&gt;save()){
              $category_taxo = new TermTaxonomy;
              $category_taxo-&gt;term_id = $this-&gt;lastCategoryId();
              $category_taxo-&gt;taxonomy = 'category';
              $category_taxo-&gt;description = $data['description'];
              if($category_taxo-&gt;save()){
                  return true;
              }else{
                  return false;
              }
          }else{
                  return false;
          }
      }else{
          $this-&gt;errors = $validator;
          return false;
      } 
  }
  </code></pre>
  
  <p>My TermTaxonomy model:</p>
  
  <pre><code>public function Term(){
      return $this-&gt;belongsTo('Term');
  }
  </code></pre>
  
  <p>then in my CategoriesController</p>
  
  <pre><code>public function store()
  {
      $data = Input::all();
      $category = new Term;
      if($category-&gt;saveCategory($data)){
          return Redirect::route('admin_posts_categories')-&gt;withSuccess('Category successfully added.');
      }
      else{
          return Redirect::route('admin_posts_categories')-&gt;withError('Failed to add category.')-&gt;withErrors($category-&gt;validation_messages())-&gt;withInput();
      }
  }
  </code></pre>
  
  <p>It works, but i think my laravel code very ugly, is there any best way method to save data one to one relationships and how to use it ?</p>
  
  <p>Thanks, sorry i am new in laravel.</p>