title: LARAVEL Argument 1 passed to ... Must be of the type array, int given
body: <p>I am trying to store an entry into a database but I get this error. </p>
  
  <blockquote>
    <p>" Argument 1 passed to Illuminate\Database\Grammar::parameterize() must be of the type array, int given, called in C:\xampp\htdocs\im-stuff\test\vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\Grammar.php on line 869 "</p>
  </blockquote>
  
  <pre><code>request()-&gt;validate(['description' =&gt; 'required']);
  $project-&gt;addTask(compact('description'));
  </code></pre>
  
  <p>Ok, so this does work, but next and better version doesn't.</p>
  
  <pre><code>$attributes = request()-&gt;validate(['description' =&gt; 'required']);
  $project-&gt;addTask($attributes);
  </code></pre>
  
  <p>So this is the model which is being used. </p>
  
  <pre><code>public function tasks()
  {
      return $this-&gt;hasMany(Task::class);
  }
  
  public function addTask($description)
  {
      $this-&gt;tasks()-&gt;create(compact('description'));
  }
  </code></pre>
  
  <p>At this point I am lost and really don't understand.</p>