title: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'category' in 'field list' in laravel 5.4
body: <p>What is this error? I try for 9.5 hours, but I'm getting an error.</p>
  
  <blockquote>
    <p>SQLSTATE[42S22]: Column not found: 1054 Unknown column 'category' in
    'field list' (SQL: update <code>articles</code> set <code>updated_at</code> = 2017-12-22
    00:28:36, <code>category</code> = 1 where <code>id</code> = 5)</p>
  </blockquote>
  
  <p>ArticleController</p>
  
  <pre><code>public function update(ArticleRequest $request, Article $article)
      {
          $file = $request-&gt;file('images');
          $inputs = $request-&gt;all();
          $article-&gt;categories()-&gt;sync(request('category'));
  
          if($file)
          {
              $inputs['images'] = $this-&gt;uploadImages($request-&gt;file('images'));
          }
          else
          {
              $inputs['images'] = $article-&gt;images;
              $inputs['images']['thumb'] = $inputs['imagesThumb'];
          }
  
          unset($inputs['imagesThumb']);
          $article-&gt;update($inputs);
  
          return redirect(route('articles.index'));
      }
  </code></pre>
  
  <p>Article.php</p>
  
  <pre><code>class Article extends Model
  {
  
      public function categories()
          {
              return $this-&gt;belongsToMany(Category::class);
          }
  }
  </code></pre>
  
  <p>Category.php</p>
  
  <pre><code>class Category extends Model
  {
      protected $fillable = ['name', 'slug'];
  
      public function articles()
      {
          return $this-&gt;belongsToMany(Article::class);
      }
  }
  </code></pre>
  
  <p>edit.blade.php</p>
  
  <pre><code>&lt;select name="category[]" class="form-control" id="category" title=" Select your category..." multiple&gt;
       @foreach( $categories as $id =&gt; $name )
               &lt;option value="{{ $id }}" {{ in_array($id , $article-&gt;categories()-&gt;pluck('id')-&gt;toArray()) ? 'selected' : '' }}&gt;{{ $name }}&lt;/option&gt;
       @endforeach
  &lt;/select&gt;
  </code></pre>
  
  <p>I want to edit the article form. </p>