title: laravel synch causes BelongsToMany::sync() must be of the type array, string given
body: <p>I am trying to synch my tags with the posts table. Two models have <code>belongsToMany</code> relationships to eachother in the model.</p>
  
  <p>My view is with bootstrap typeahead to autosuggest me tags and get the old values:</p>
  
  <pre><code>&lt;input type="text" data-provide="typeahead" value="{{ Input::old('tags', $theTags) }} class="typeahead" data-items="1" name="tags" "/&gt; 
  </code></pre>
  
  <p>iin the controller, I check if a tag is included in the db, otherwise I create db entry for the tag:</p>
  
  <pre><code>public function postEdit($postId = null)
      {
          $theTags=array();
          $tags = explode(',', Input::get('tags'));
  
           //check if tag exists in db        
          foreach ($tags as $key=&gt;$value){
          $dbtag = Tag::where('name', '=', $value)-&gt;first();
          array_push($theTags, $dbtag);
  
          //add to db
          if(!$dbtag){
             $dbtag = new Tag;
             // Update the tag
            $dbtag-&gt;name= e(ucwords($value));
            $dbtag-&gt;slug  = e(Str::slug($value));
            $dbtag-&gt;save(); 
            array_push($theTags, $dbtag);      
             }
           }
          // Update the blog post data
          $post-&gt;title  = e(Input::get('title'));
  
          $author = Author::find(Input::get('author_id'));
          // Was the blog post created?
          if($author-&gt;posts()-&gt;save($post))
          {
              $post-&gt;categories()-&gt;sync(Input::get('categories'));
              $post-&gt;tags()-&gt;sync(Input::get('tags'));
  
              // Redirect to the new blog post page
              return Redirect::to("admin/blogs/$postId/edit")-&gt;with('success', Lang::get('admin/blogs/message.update.success'));
          }
  
      }
  </code></pre>
  
  <p>I am getting error of :</p>
  
  <pre><code>Argument 1 passed to Illuminate\Database\Eloquent\Relations\BelongsToMany::sync() must be of the type array, string given, called in /home/ytsejam/public_html/remaker/app/controllers/admin/BlogsController.php on line 273 and defined
  </code></pre>
  
  <p>Can you show me to get the correctly synch the tags ? </p>
  
  <p>ps: I tried to add another array $theTags ,I am using array_push on them .  when I try with </p>
  
  <pre><code>$post-&gt;tags()-&gt;sync($theTags); 
  </code></pre>
  
  <p>I am getting illegal offset error:</p>